views:

124

answers:

1

So, it may be sounds as a realy newbies question... And proboly it is newbies :)

I try to turn infomation from boost::asio::streambuf which I got, using read_until into char*. I've found realy many examples of turning it into std::string, but I'd mad, if use bufer -> std::string -> c_str in an application, needs a high perfomanse. (But in fact, I ectally do not realy stuff like conteiners and so on.)

+1  A: 

You are assuming that converting a std::string into a C string hurts performance.

This should not be assumed. std::string is often implemented as a wrapper around a C string.

If you are unhappy with current performance, start by using a run-time profiler on your code.

Shmoopty
M... Okay... Thanks...I had seen only reading from stream, made by streambuf way of doing that (and it was realy slow), now I've found better ways of doing that. (through iterators)
MInner