Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<unsigned n>
- struct Get {
- template<class X, class…Xs>
- constexpr auto operator()(X x, Xs…xs) {
- if constexpr(n > sizeof…(xs) ) {
- return;
- } else if constexpr(n > 0) {
- return Get<n-1>{}(xs…);
- } else {
- return x;
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement