prog.cpp:6:30: warning: explicit conversion operators only available with -std=c++11 or -std=gnu++11 [enabled by default]
explicit operator bool() const { return true; }
^
prog.cpp: In function ‘int main()’:
prog.cpp:11:35: error: invalid static_cast from type ‘test’ to type ‘float’
float b = static_cast<float>(a);
^
prog.cpp:11:11: warning: unused variable ‘b’ [-Wunused-variable]
float b = static_cast<float>(a);
^