I could have a queue<char*> file_queue; but than I would need to clean up after each char*. I have a dinamic variable int buff_length; that would be length of each char in file_queue. It would be set once from a config file before queue creation. So I wonder – is it possible to keep char[buff_length] inside one boost::shared_ptr and how to do such thing?
I could have a queue<char*> file_queue; but than I would need to clean up
Share
You can use a
shared_array:Any reason why
std::stringorstd::vector<char>is not appropriate for your situation?Note, with C++11 you can use the following:
std::unique_ptrhas a specialization to deal with arrays. I was under the mistaken belief thatboost::shared_ptrdid too, but evidently that was incorrect.