Does anyone know if it is possible to enable any way of logging on any C ++ compatible compiler (Visual Studios, g ++, etc.) so that I can detect when temporary objects are created?
For instance:
Say I have a function f(char x) , but I call it with f(46)
I'll see in the magazines -
temporary char created promoting int @ function param f(46) (or something like this)
I read the VS compiler switch options, and it seems like this is not an option.
I understand that in the new standard there is the concept of rvalue reference (& &), which can be used to detect the majority of times for movement semantics, but this is due to the addition of a new compiler compatible with the / code. >
So can this be done? Or is it privileged compiler knowledge?
user1348669
source share