Created
January 7, 2020 10:05
-
-
Save JohanMabille/b9b4d345fa5edec0b030a0346666399f to your computer and use it in GitHub Desktop.
This file contains 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 <class T, std::size_t I> | |
struct nested_initializer_list | |
{ | |
using nested_type = | |
typename nested_initializer_list<T, I - 1>::type; | |
using type = std::initializer_list<nested_type>; | |
}; | |
template <class T> | |
struct nested_initializer_list<T, 0> | |
{ | |
using type = T; | |
}; | |
template <class T, std::size_t I> | |
using nested_initializer_list_t = | |
typename nested_initializer_list<T, I>::type; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment