Hello,
When compiling example below, you will get warning:
#469: temporary used for initial value of reference to non-const (anachronism)
and when another overload is added (see comment) warning disappears, but compiler still choose "BOOL" overload instead of "OBJECT". Note that disabling microsoft extensions (/Za) brings warning back.
We are using x64 compiler for visual studio 2013, version 15.0.1.148 build 20141023 on windows 7.
#include <iostream> struct T {}; struct P { P(T*) {} }; void f(bool&) { std::cout << "BOOL"<< std::endl; } //uncomment this function to hide compilation warning //void f(P) { std::cout << "OBJECT"<< std::endl; } int main() { f(new T); return 0; }