Boost logo

Boost :

Subject: Re: [boost] Interest check: constant input matching manipulator
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-04-08 16:24:30

On Wednesday, April 08, 2009 3:20 PM
Francois Barel wrote:
> Eugene Wee wrote:
> > Does anyone think that adding such a manipulator to Boost would be


> > desirable? I expect the syntax to be along these lines (names and
> > namespaces to be decided):
> > std::cin >> match("a=") >> a;

I'm not entirely comfortable with "match." What about "literal" or "exactly?"

> Spirit2 already provides such functionality:
> #include <boost/spirit/include/qi.hpp>
> #include <boost/spirit/include/qi_stream.hpp>
> [...]
> using namespace boost::spirit;
> using namespace boost::spirit::qi;
> std::cin >> match("a=" >> int_, a);

That's a lot of noise and the syntax is non-obvious for the purpose at hand. I suspect unwarranted compilation overhead, too. Something simpler seems in order:

   #include <boost/something/literal.hpp>
   using boost::something::literal;

   int a;
   std::cin >> literal("a=") >> a;

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

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