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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -