GCC and Clang template call resolution differences

According to overload resolution, there are two viable functions: The specialization of the global operator|-template with deduced arguments and the specialization of the member operator function template. Both have the same signature – the member function template has an implicit object parameter of type Alice const& (see ยง13.3.1/4).

So both viable functions (after template argument deduction) have the same signature. And neither of the templates from which they were instantiated is more specialized than the other. So this is indeed an ambiguity and therefore ill-formed. Surprisingly, VC++ is correct.

How can I force the same behaviour?

Perhaps you should just remove the ambiguity, Clang, VC++ and GCC should have the same behavior then.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)