Boost logo

Boost :

Subject: Re: [boost] [spirit] Support for one-pass iterators?
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-10-19 12:55:12


Hartmut Kaiser wrote:
>
> > Hmm... I may be misinterpreting what I see at
> > boost/spirit/home/qi/nonterminal/grammar.hpp:54, in the
> > release branch:
> >
> > grammar(
> > start_type const& start
> > , std::string const& name_ = "unnamed-grammar")
> > => : proto::extends<terminal,
> > base_type>(terminal::make(start.alias()))
> > , name_(name_)
> > {}
> >
> > Here "start" is a reference to a not yet constructed object.
>
> All the construct is doing is to use the address of start
> (which is known
> and well defined at this point). The address of an object
> doesn't change
> during construction. Just look at the code, you'll see it.
> The code does not
> refer to any member data items of 'start'. I see no problem
> with this.

It would appear that the point of confusion is "start.alias()." That appears to invoke a start_type member function on, apparently, a reference to a data member in a derivate.

It is legal to use &start to initialize a pointer, but I think calling any member function is not. I'd have to look over the standard language carefully to state that unequivocally.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk