AMDG cp now wrote:
The type_traits library gives me somewhat erroneous answers when dealing with pairs of pairs.
The following code produces the errors below, but interestingly, the BOOST_ASSERT actually succeeds. It seems is_convertible thinks a pair
, int> is convertible to a plain old pair , but the compiler (and this coder) takes a different view...
It's impossible to make it work in the general case.
boost::is_convertible only checks whether
there is a non-explicit constructor. To make the check work, we would
need to somehow
instantiate the constructor and detect whether compiling it succeeded of
not. There is no way
to do this in C++.
Not possible:
template