Boost logo

Boost :

From: John Torjo (john_at_[hidden])
Date: 2003-05-02 04:02:01


----- Original Message -----
From: "Justin M. Lewis" <boost_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Friday, May 02, 2003 11:29 AM
Subject: Re: [boost] Re: in/out parameters, codingstylesandmaintenance

> Oh, there's posted code for these things.
> http://groups.yahoo.com/group/boost/files/in_out/
>
Indeed, I took a look at it.
However, from your solution, we're back where we started. Something like:

void add_char( in_out< std::string> & s, char ch)
{ std::string & str = s.ref(); str += ch; }

The solution I proposed, allows you to write this:
void add_char( in_out< std::string> & s, char ch)
{ str += ch; } // no extra conversion needed

(by deriving in_out from the original type, with NO OVERHEAD)

Best,
John


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