Hacker News new | ask | show | jobs
by 8xde0wcNwpslOw 2960 days ago
I can't guarantee I'm right, but AFAIK that's sort of a templated typedef, where the bound type is that of the return value of method "func" of class U. Short example:

  class Foo {
    int func();
  };

  // func_type<Foo> = int
Also, for more info, see http://en.cppreference.com/w/cpp/language/type_alias, https://en.cppreference.com/w/cpp/language/decltype.
1 comments

Thanks, in type_alias document I see the example:

    template<class T>
    using Vec = vector<T, Alloc<T>>; // type-id is vector<T,   Alloc<T>>
    Vec<int> v; // Vec<int> is the same as vector<int, Alloc<int>>
That explains to me the using construct.

And tcbawo's answer tries to address the U{}.func()

However "either of which could apply to U{}" ... I'd expect that it should be possible to say which of these is in this example? I also can't see how that can (or should?) match "aggregate_initialization."