|
Boost Users : |
Subject: Re: [Boost-users] use of boost::noncopyable ?
From: Daryle Walker (darylew_at_[hidden])
Date: 2012-03-21 08:43:10
> Date: Wed, 21 Mar 2012 09:18:30 +0200
>
> > I interpreted the error, which cited the class itself and not anything in my
> > code that uses the class, to mean that the auto-generation was not
> > suppressed at all and in fact prevented it from being successful rather than
> > silently being not generated.
> >
> > It turns out that something in my code did want the assignment, so the class
> > "did its job" but was totally unhelpful in telling me where in the code this
> > was.
>
> To get more helpful error, declare a private copy-ctor & assignment
> operator in your class - and you'll see who attempts to copy.
I wonder if we should add an extra inheritance layer. We would make a new noncopyable_inner class with the disabling code, then have the current noncopyable inherit from the new class.
Daryle W.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net