|
Boost : |
Subject: Re: [boost] Boost.Convert+Boost.Parameter
From: Vladimir Batov (batov_at_[hidden])
Date: 2009-02-28 16:45:15
> From: "Hartmut Kaiser" <hartmut.kaiser_at_[hidden]>
>> 1. Employ operator<< and operator>> for user-defined types.
>
> Spirit supports that out of the box in two ways.
>
> a) it has the 'stream' primitive utilizing the user type supplied
> operator>>() and operator<<() for parsing/generating. I.e.
>
> user_type u;
> spirit::qi::parse(str, spirit::stream, u);
> spirit::karma::generate(std::back_inserter(str), spirit::stream, u);
Hartmut, 'parse' does str->user_type and 'generate' does user_type->str,
right? Is it (the support for conversions and user types) anywhere in the
documentation? If it all that easy, I'll wrap it up into the API of my
liking and we'll use it instead of lexical_cast. The whole 'convert' saga
seems for nothing. Given how long this lexical_cast/convert discussion's
been dragging on I feel you might spend some time educating more people
(besides me) how to deploy Spirit for mundane taks like conversion. How do
you handle failed conversion? Where do I do to learn Spirit? The docs seem
preoccupied with big stuff.
[rant] As a side note I just love to see
"spirit::qi::parse...spirit::stream" given some've could not stand my humble
"convert::to" and "convert::from". I am sure they gonna love yours. LOL.
Best,
V.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk