Skip to content

Instantly share code, notes, and snippets.

@Dich0tomy
Last active August 25, 2021 19:42
Show Gist options
  • Save Dich0tomy/22be4dce2e4442d17fdc2be21d5784eb to your computer and use it in GitHub Desktop.
Save Dich0tomy/22be4dce2e4442d17fdc2be21d5784eb to your computer and use it in GitHub Desktop.
An incredibly simple thing that let's you make nested templates sheesh right
template <template <typename...> typename Template, std::size_t Size, typename... Type>
struct make_nested {
using internal = Template<typename make_nested<Template, Size-1, Type...>::internal>;
};
template <template <typename...> typename Template, typename... Type>
struct make_nested<Template, 1, Type...> {
using internal = Template<Type...>;
};
template <std::size_t Size, typename Type, typename Alloc>
using nested_vec = typename make_nested<std::vector, Size, Type, Alloc>::internal;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment