|
Boost : |
Subject: Re: [boost] [utility] Proposal to extract some components from Boost.Log
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-09-01 13:11:07
On Sunday 01 September 2013 15:52:53 you wrote:
> On Sunday 01 September 2013 07:46:40 John Bytheway wrote:
> > But this works:
> >
> > struct foo
> > {
> >
> > void* m_p;
> >
> > constexpr explicit operator bool () const
> > {
> >
> > return !this->operator!();
> >
> > }
> >
> > constexpr bool operator! () const
> > {
> >
> > return !m_p;
> >
> > }
> >
> > };
> >
> > int main()
> > {
> >
> > constexpr auto f = foo{nullptr};
> > constexpr auto b = bool(f);
> > return b;
> >
> > }
>
> That would force the user to have constexpr operator!, which is not always
> possible. I think two macros are a better choice.
Extracted the macro.
https://svn.boost.org/trac/boost/changeset/85543
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk