문제

All my attempts so far have failed.Basically when I return a copy of the internal char array of the string, that copy has to be released, but I don't know how to release it.Wrapping it in a smart pointer doesn't work out, since it's destructor gets called immediately after I return it.Must I implement something like a garbage collector just for the immutable string?

도움이 되었습니까?

해결책

const std::string will be fine.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top