Created
June 1, 2019 03:37
-
-
Save takiyu/470bb48c5dccfa621777de8ffa7271bb to your computer and use it in GitHub Desktop.
nested_initializer_list
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 <typename T, std::size_t T_levels> | |
struct NestedInitList { | |
using type = std::initializer_list< | |
typename NestedInitList<T, T_levels - 1>::type>; | |
}; | |
template <typename T> | |
struct NestedInitList<T, 0> { | |
using type = T; | |
}; | |
template <typename T, std::size_t T_levels> | |
using NestedInitListT = | |
typename NestedInitList<T, T_levels>::type; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment