Skip to content

Instantly share code, notes, and snippets.

@codehz
Created November 6, 2019 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codehz/b18c62d104f2b7f1a4f3bfb44c5d249b to your computer and use it in GitHub Desktop.
Save codehz/b18c62d104f2b7f1a4f3bfb44c5d249b to your computer and use it in GitHub Desktop.
#include <vector>
template <typename T>
struct unwrap {
using type = T;
};
template <template <typename> typename wrapper, typename T>
struct unwrap<wrapper<T>> {
using type = T;
};
template <template <typename, typename> typename wrapper, typename T, typename R>
struct unwrap<wrapper<T, R>> {
using type = T;
};
int main() {
typename unwrap<std::vector<int>>::type a = 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment