fork download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. using namespace std;
  5.  
  6. template <typename T>
  7. class TWeakObjectPtr {
  8. public:
  9. T* Get(bool) { return nullptr; }
  10. };
  11.  
  12. int main() {
  13. TWeakObjectPtr<int> foo;
  14.  
  15. if (is_same<remove_pointer_t<decltype(foo.Get(bool()))>, int>::value) {
  16. //if (is_same<result_of_t<decltype(&(decltype(foo)::Get))(decltype(foo)&)>, int*>::value) {
  17. cout << "true" << endl;
  18. }
  19. else {
  20. cout << "false" << endl;
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
true