Why are you passing the string by pointer? If you instead pass the string by const reference it will automatically construct and pass a string object when you pass a char*.
What is the difference between & and the * i used? And i tried constant pointer, it didn't work (wasn't expecting it to :D)
And peter i already knoe i can do that, this was mostly out of curiosity and because i already remeber seeing some library likre that (opengl related or something )
I used pointer for performance, it doesn't create a copy that way!
With modern C++, with move semantics, passing a string [by value] doesn't make a deep copy either, so there's nothing wrong with doing that.
That is only true when passing a rvalue-reference. If you pass a string variable (without using std::move or similar) to a function that takes the string argument by value it would still have do a deep copy.