fork download
  1. #include <iostream>
  2.  
  3. struct X {};
  4.  
  5. template<typename T>
  6. struct Promise {};
  7.  
  8. template<typename T> constexpr bool isPromise = false;
  9. template<typename T> constexpr bool isPromise<Promise<T>> = true;
  10.  
  11. int main()
  12. {
  13. std::cout << isPromise<int> << ' ' << isPromise<X> << std::endl;
  14. std::cout << isPromise<Promise<int>> << ' ' << isPromise<Promise<X>> << std::endl;
  15. return EXIT_SUCCESS;
  16. }
  17.  
Success #stdin #stdout 0s 4328KB
stdin
Standard input is empty
stdout
0 0
1 1