Last active
August 25, 2021 19:42
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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