Skip to content

Instantly share code, notes, and snippets.

@xaxxon
Created October 30, 2017 15:24
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 xaxxon/dfb14a1764a1c951392344603c066342 to your computer and use it in GitHub Desktop.
Save xaxxon/dfb14a1764a1c951392344603c066342 to your computer and use it in GitHub Desktop.
template<template<class...> class tmpl, typename T>
struct _is_template_for : public std::false_type {};
template<template<class...> class tmpl, class... Args>
struct _is_template_for<tmpl, tmpl<Args...>> : public std::true_type {};
template<template<class...> class tmpl, typename... Ts>
struct is_template_for : public std::conjunction<_is_template_for<tmpl, std::decay_t<Ts>>...> {};
template<template<class...> class tmpl, typename... Ts>
constexpr bool is_template_for_v = is_template_for<tmpl, Ts...>::value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment