Created
January 5, 2022 09:02
-
-
Save buffyanamin/9e590ad58dad872989e786cffba66a6a to your computer and use it in GitHub Desktop.
Get nth element from c++ variadic template argument
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 <int I, class... Ts> | |
decltype(auto) get(Ts&&... ts) { | |
return std::get<I>(std::forward_as_tuple(ts...)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment