
15 May
2010
15 May
'10
8:18 a.m.
On 15 May 2010 06:23, deninok <shev.denis@gmail.com> wrote:
You are right, but what if length of enc is 1000000 symbols or more? Copying (in return operation) will be expensive.
Well, http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ That said, I prefer the enc(a, b); form because it allows b to be something other than a std::string without needing to to write out the name of the type. I think what you'll find is that to be accepted, the library will need to offer far more than just a std::string -> std::string interface. At a very minimum it should be able to read from/append to a vector<char>, and it should probably offer something like a streambuf adaptor as well so that it can be used non-invasively.