On 15 January 2016 at 17:52, James Greenhalgh wrote:
>   vbrfix_0.24-7
>
>     [ Source error, not sure how this ever worked! ]
>
>     In file included from vbrfix.h:22:0,
>                      from vbrfix.cpp:17:
>     wputil.h: In static member function 'static bool wfile::copyFile(const 
> char*, const char*, bool)':
>     wputil.h:202:28: error: cannot convert 'std::basic_ostream<char>' to 
> 'bool' in return
>          return out << in.rdbuf();

In C++03 iostreams have an implicit conversion to void*, which can
then be implicitly converted to bool.

In C++11 they have an explicit conversion to bool, so the code needs
to be changed to do the conversion explicitly:

         return bool(out << in.rdbuf());

or

         return static_cast<bool>(out << in.rdbuf());

         if (out << in.rdbuf())
           return true;
         return false;

or

         return (out << in.rdbuf()) ? true : false;

or some similar variation.

Reply via email to