c++ - Why ostream is not convertible to ostream? -
i doing type checking in project. following example
using namespace std; cout << ( is_convertible<ostream,ostream>::value ? "true":"false" ) << endl; returns "false".
could explain why?
is_convertible tests if imaginary function
test() { return std::declval<from>(); } is formed (source).
std::ostream alias std::basic_ostream<char>. copy constructor deleted, , move constructor protected.
so test imaginary function not formed.
in short, asked if can move construct ostream ostream, , answer "no".
Comments
Post a Comment