Loki functor - problem with memory?

The problem is that Loki's functor object is not making a true copy of the string, but rather is storing a reference to the string object that you are wanting to have bound to your function. This is because loki's functor object stores a reference type if the type of the argument being bound is not a pointer, member pointer, or arithmetic type (i.e. , a type you can perform an arithmetic operation with).

So since the string is a temporary, and only a reference to the temporary is stored, once the stack unwinds from the function call, access to the temporary string is lost from the internal reference in the binder object, and you are unable to print the string.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions