I think that the documentation contains a wrong paragraph for the auto_buffer <...>::empty function.
http://www.stlsoft.org/doc-1.9/classstlsoft_1_1auto__buffer.html#c6e61de369e994009e36f344f99c15ad
-- quote.begin ()
Indicates whether the buffer has any contents.
Note:
This will only ever be true when an allocation above the number of elements in the internal array has been requested, and failed.
-- quote.
As a side note, the second paragraph (the note) should be rephrased to clarify the meaning of its first word ("this"). When read immediately after the first paragraph, one might have thought that "this" stood for "whether the buffer has any contents". But it really stood for "[the return value of the] empty [function]".
But the real issue is that the empty function can return true in many other circumstances, the simplest of which being illustrated by this example:
stlsoft::auto_buffer <float> x; // Default construction.
std::cout << x.empty () << "\n"; // Prints "1".
Another simple example involves calling the resize function with 0 as the new size.
Thank you ! (-:
Was a flat-out error - a vestige from an earlier time when the user was not allowed to pass 0 to the ctor. Will be included in next release.
Thanks! :-)