Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-09-21 01:08:46


Reece Dunn wrote:

> Vladimir Prus wrote:
>>There are some things I don't like. First, as many mentioned, the naming
>>is not optimal.
>>[snip]
>>or maybe even
>>
>> ("[" + io(v)/"," + "]")
>>
>>for nested formats, something like
>>
>> ("["
>> + io::format(
>> "(" + io::format()/":" + ")"
>> )/","
>> +
>> "]"
>> )
>>
>>These are just ideas, though.
>
> In my development version, I now have this working! That is, you can do:
>
> std::cout << io::object
> (
> std::make_pair( 'a', 5 ),
> "{ " + fmt::pair()/" == " + " }"
> ) << '\n'; // output: { a == 5 }

Great. I wonder what others think? Personally, I really like the / operator.
Probably that's because I've borrowed the idea from one parser generator
which allows to write:

    (literal / "," )

to mean a list of literals separated by ",". The opening and closing braces
look less clear for me now. Maybe, we can use

   fmt::pair("{", "}")/" == "

or

   fmt::braces("{", "}") + fmt::pair()/" == "

But I'm really really not sure.

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk