fork(3) download
  1. #include <type_traits>
  2. #include <iostream>
  3. #include <memory>
  4.  
  5. template<template<typename> class X, typename T> struct instantiation_of : public std::false_type {};
  6. template<template<typename> class X, typename Y> struct instantiation_of<X, X<Y>> : public std::true_type {};
  7.  
  8. int main() {
  9. std::cout << instantiation_of<std::shared_ptr, int>::value << "\n";
  10. std::cout << instantiation_of<std::shared_ptr, std::shared_ptr<int>>::value << "\n";
  11. }
Success #stdin #stdout 0s 2928KB
stdin
Standard input is empty
stdout
0
1