Hacker News new | ask | show | jobs
by jcelerier 2245 days ago
could you provide the type of this map function ?

    auto map(auto x) { 
      if constexpr(is_same<decltype(x), int>) {
       struct T1 { int getStuff() { return 0; } };
       return T1 {};
      } else { 
       struct T2 { void doStuff() { } };
       return T2 {};
      }
    }
1 comments

Read the rest of the discussion.