Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2005-10-10 11:15:39


Howard Hinnant wrote:
> On Oct 10, 2005, at 10:36 AM, Fernando Cacciola wrote:
>
>>> Dubious of use of references.
>>
>>Does this mean they don't see that as useful or that is not well
>>supported?
>
>
> I believe there was specific concern about reference rebinding under
> optional<T&>. There were also several comments that went like: I use
> optional all the time (gives use case), but I've never needed to use it
> with reference types.

[...]

> You might explore a interface here on boost which did not have the
> pointer interface, and which dropped reference support. Then perhaps
> submit a follow on paper reflecting that experience. Said paper may
> either modify your current proposal, or more fully support it.

I use optional reference but I do not like the way rebinding works.
I still insist that it follow the way boost::tuple does it. IMO,
the same way with tie, when you need it, you'll really need it.
I think it was I who requested for optional references, so let me
present my use case:

In Spirit, a parser may return an attribute. This attribute should
only be constructed on a successful match. Thus, optional<T>.
A symbol table is a parser in Spirit. Each symbol has a corresponding
data slot. On a successful match, the attribute returned is a
reference to the data slot. Thus optional<T&>.

Ah, yes, and I will forever be against the pointer interface.

Zen of Python:
...
There should be one-- and preferably only one --obvious way to do it.
...

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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