|
Boost : |
From: Oleg Abrosimov (beholder_at_[hidden])
Date: 2006-05-09 11:05:54
Ronald Garcia:
> The review of Joel de Guzman's Fusion library begins today, May 1,
> 2006, and continues through May 10, 2006.
Hello!
One note about fusion::tuple I/O manipulators:
"The library defines three manipulators for changing the default behavior:
Manipulators
tuple_open(arg)
Defines the character that is output before the first element.
tuple_close(arg)
Defines the character that is output after the last element.
tuple_delimiter(arg)
Defines the delimiter character between elements."
"Example:
std::cout << tuple_open('[') << tuple_close(']') << tuple_delimiter(",
") << a;"
I see a usability issue here. I believe that if one needs to specify
tuple_open then he would need to specify tuple_close too.
I propose to change tuple manipulators to be:
1) tuple_bounds("(", ")") // if need to specify one bound, I need to
specify both.
2) tuple_delimiter(",") // I'm happy with bounds, but delimiter should
be specified.
3) tuple_punc("(", ",", ")") // I should specify all punctuation.
furthermore, I believe that these manipulators are more general. They
could be used with any sequence, not only with tuples.
May be it should be factored out to separate library and named
appropriately?
1) seq_bounds("(", ")") // if need to specify one bound, I need to
specify both.
2) seq_delimiter(",") // I'm happy with bounds, but delimiter should be
specified.
3) seq_punc("(", ",", ")") // I should specify all punctuation.
seq stands for sequence.
Best,
Oleg Abrosimov.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk