error: the compiler can assume that the address of '...' will always evaluate to 'true'
This confusing error has been seen in the following situations ...
when passing a pointer, to a function or operator which understands bool but not the pointer type that you’re passing, for example: myObject << &object;
when returning the dynamic_cast of an address, from a function, when the return type is bool, for example: return dynamic_cast<const YourClass*>(&object);
Some solutions ...
Try casting the address using static_cast<const void*>(&object).
Try casting the address using reinterpret_cast<const void*>(&object).
Try creating a variable to hold the cast value, then use that variable instead.
Tags: error the compiler can assume that the address of will always evaluate to 'true', the compiler can assume that the address of, will always evaluate to 'true', C++