Boost logo

Boost :

From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2003-10-06 09:28:48

At 15:23 2003-10-06, David Abrahams wrote:
>Daniel Wallin <dalwan01_at_[hidden]> writes:
> > I guess you could always use some exotic operator overloading to shorten
> > the getter functions.
> >
> > p.value(name).get("unnamed") -> p[name | "unnamed"]
> >
> > Or something like that, but I'm not sure I think the first version is too
> > verbose. :)
>Well, I think your syntax suggestion is beautiful! However, I think
>there may be some inmplementation difficulty. Can you implement it?
>There was a reason I went with the two-call .value(x).get(y) syntax.

Yes, here's an implementation that uses your value(x).get(y) internally.
I might have missed something that will break this, but at least the tests
work as expected.

Daniel Wallin

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