
9 Feb
2012
9 Feb
'12
5 p.m.
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.