On 29/05/2015 21:18, Peter Dimov wrote:
And while you're on a roll.... can you see how to fix https://svn.boost.org/trac/boost/ticket/7544? common_type should have member ::type only when such a common type exists.
On C++11 or on C++03?
On C++11, it's as easy as
template
struct common_type { }; template<class T> struct common_type: decay<T> { };
template
struct common_type
: common_type { }; On C++03... I don't know, is there a point? It needs expression SFINAE and default template parameters for function templates and will probably not compile on most non-C++11 compilers anyway. Might be useful in principle on clang/gcc in C++03 mode, but is this an important target?
Probably not, I suspect C++11 only support is fine. The above is really neat BTW, I tried something similar in VC++ and couldn't get it to work :( John.