Subject: Re: [boost] [optional] generates unnessesary code for trivial types
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-02-09 12:00:07
On Thursday, February 09, 2012 15:33:03 Andrzej Krzemienski wrote:
> I believe that
> optional<reference_wrapper<T>> would serve your purpose best. Or would it
> also introduce the lack of uniformity?
Interesting. I'm not sure it's going to work because reference_wrapper won't
have T's operators. The compiler may find the operators via ADL, but calling
them will require an implicit cast from reference_wrapper to T&, which may
mess up overload resolution. I think, optional<T&> is closer to my needs.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk