Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-01-24 10:01:16

Fixed String review - Andy Little


The rationale of fixed_string seems very good though especially the C-style
interface. I think it would be a useful boost library. Formatter seems to be a
useful feature. Users regularly ask for C style string formatting.

*Did you try the library. With what compiler.*

Unfortunately wont compile on VC7.1:

 boost::fixed_string<5> fs = "Hello"; // Can you do this . If not then why not?

c:\boost\boost_1_33_0\boost\fixed_string\fixed_string.hpp(602) : error C3861:
'assign': identifier not found, even with argument-dependent lookup.

boost::fixed_string<5> fs ("Hello"); // Assume can do this from tests

c:\boost\boost_1_33_0\boost\fixed_string\fixed_string.hpp(390): error C3861:
'buffer_': identifier not found, even with argument-dependent lookup


Sorry documentation is not very good at all. Starting with implementation stuff
in boost::detail is off-putting, makes no sense. If it is interface then
shouldnt be in detail namespace IMO. Is any implementation stuff in docs
really necesssary? Interested users can look at headers anyway
I think requirements is wrong name for the Requirements section as requirements
has different connotation. Features or rationale might be better.
I would like some useage examples early in the documentation. Same for formatter

Couldnt there be a requirements and effects section for each string operation?.
Details of formatter spec in documention?

*Design *

I would prefer a lot more detail on the functionality of fixed_string. What
happens on overrun for example? Is it mentioned?

In Requirements section it states that fixed_string must be direct replacement
for char array. What does that mean exactly. Does that include run time
performance or utility . Run-time performance would seem to be an important goal
anyway. Has this been achieved both in terms of e.g copying speed and in terms
of code size, else what are the tradeoffs?

What is meant by variable capacity for a fixed_string<N>?. The template
parameter would suggest a fixed capacity. Does variable capacity require per
string state?

Formatter. Why does formatter need to be a policy? Cant it be a separate entity
to fixed_string? What is relation (if any) to boost::format. Maybe though
fixed_string formatter is another library to fixed-string? Could fixed_string
use boost::format interface? Documentation doesnt seem to have details on
formatter input

What happens between fixed_string and std::string. Are they compatible? Example
code would help to show a few scenarios.


I think the documentation needs to be rewritten with more detail. I'd like to
be able to test the library too. A list of compilers that it has been tested on
would help. Because of these things I vote no, but I'd be very keen if the
documentation was improved and could compile. Sorry I hadnt time for a more
detailed review.

Andy Little

Boost list run by bdawes at, gregod at, cpdaniel at, john at