Re: [eigen] private copy ctors |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi
Zitat von Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> There were actually occasions when that error was issued without
> const
> members - I don't recall exactly which classes/structs it were - and
> that is
> why I initially chose the current approach.
Too bad. Would be really interesting to know. They also didn't derive
from classes with const members? No reference members either? I tend to
believe that VC.NET is not buggy in this area.
> > Wow, you used the words "nicer" and "macros" in the same sentence
> :-D
> >
>
> Yes, that starts to happen when you want to write portable code...
> "nicer" =
> "less intrusive".
I know, I know. That remark wasn't completely serious. :)
> It would probably not complain but why would this be the cleanest
> solution? Boost's noncopyable does exactly the same as I did -
> private, unimplemented assignment (plus and copy ctor). You just move
> the linker errors to the base class.
Yes. The biggest advantage is that it documents what you're doing.
class X : nonassignable
{
...
};
is much easier to understand than
class X
{
X& operator= (const X&);
...
};
(you wouldn't even know whether or not it's defined!)
Markus