|
Boost : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2004-09-20 15:43:29
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 }
and:
std::cout << io::object
(
std::make_pair( std::make_pair( 'a', 1 ), std::make_pair(
'b', 2 )),
"{ " + fmt::pair
(
"< " + fmt::pair()/" + " + " >",
"( " + fmt::pair()/" | " + " )"
)/" = " + " }"
) << '\n'; // output: { < a + 1 > = ( b | 2 ) }
I have tested with VC 7.x and 8.0. VC7.0 has some problems, but the others
build it fine.
Regards,
Reece
_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk