I believe that the behavior you see is due to the fact that "anonymous temporary data cannot be passed to functions as non-constant links" (well, not really NOT, but they have undefined behavior or different behaviors on different compilers), Thus , it goes to the <operator in the last line, but it detects an element overload (const void *) for the <operator, not an overload (const char *) overload, mainly due to the rule above. Thus, temporary A is built and passed to the <operator, which returns a non-constant reference.
Thus, now the operator <(const void *) is defined as a member of the class, while the operator <(const char *) is a free function. When a function is called in non-constant time mode, the only function corresponding to the argument is looked up in member functions and no free functions are mapped to it. I know that MSVC treats GCC differently.
Infact, if you try to change the string "checking this" to something less so that you can see its value (convert it from char * to void * and see what value you get), you will see that it actually prints void * cast of "check this out." Thus, the destructor is called at the very end, but <made a char * for void *, and that is what is printed.
source share