fork(2) download
  1. #include <iostream>
  2. #include <type_traits>
  3. #include <typeinfo>
  4.  
  5. using namespace std;
  6.  
  7. template <typename T>
  8. decltype(T(), bool()) isConstructable() { return true; }
  9.  
  10. int main() {
  11. cout << typeid(isConstructable<int>()).name() << ' ' << is_rvalue_reference<decltype(isConstructable<int>())>::value << ' ' << isConstructable<int>() << endl;
  12. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
b 0 1