Peter Dimov wrote:
Once C++14 becomes an official standard, it'd become possible for N3640 to be discussed and, hopefully, accepted;
I then tried to get the buffer length (in code) but hit a brick wall.
int len = buffer.length; // doesn't exist int len = buffer.length(); // doesn't exist int len = buffer.capacity; // doesn't exist int len = buffer.capacity(); // doesn't exist int len = buffer.size; // doesn't exist int len = buffer.size(); // doesn't exist
I thought about it a little, and I guess I could write a wrapper class around shared_ptr<> to provide buffering features.
class shared_buffer : public shared_ptr< unsigned char [] > { size_t capacity; ... }
I can't stop thinking about this. What would be the harm in providing a 'capacity()' member ?
buffer = boost::make_shared< unsigned char[] >( 1234 );
int capacity = buffer.capacity();
It can be designed such that that no matter how the new 'shared_ptr