P0091 is voted into C++17, but for outsiders it's unclear what decisions/changes has been made since:
* What's the syntax settled for explicit deduction guides?
The proposed syntax in P0091R2 is:
template < template-parameter-list > class-name ( parameter-declaration-clause ) -> simple-template-id
The author also listed some alternatives and left the decision to the committee, what's the committee's decision?
Is it possible for a syntax that doesn't require us to repeat the class-name twice, e.g:
template-parameter-list > simple-template-id auto( parameter-declaration-clause )
template<typename Iter>
vector<typename iterator_traits<Iter>::value_type> auto(Iter b, Iter e);
* Are non-template explicit deduction guides allowed?
template<class T>
struct S
{
S(T);
};
S(char const*) -> S<std::string>;
S s{"hello"}; // deduced to S<std::string>
* Does the deduction work for aggregates?
template<class A, class B>
struct Agg
{
A a;
B b;
};
Agg agg{1, 2.0}; // ok? deduced to Agg<int, double>
If the above doesn't work, will explicit deduction guides help?
template<class A, class B>
Agg(A a, B b) -> Agg<A, B>;