1. The explicit keyword cannot be applied to an out-of-line definition.
For example
1 2 3 4
struct A { explicitoperatorbool() constnoexcept; };
/* explicit must not appear here */
A::operatorbool() constnoexcept { returntrue; }
2. explicit conversion operators are a feature added in C++11.
To work around the second (potential) issue in legacy C++, consider implementing an implicit conversion operator to void* instead, i.e., using the now-outdated safe-bool idiom https://www.artima.com/cppsource/safebool.html