Stephan Bergmann wrote:
Nikolai Pretzell wrote:
[...]

Conclusion and suggestion
=========================

1)
The warnings don't give any additional information. Any attempt to copy such a class results in a compiler error anyway.


The information is given when defining the class, not when using it, so the warning can be of value when creating an API

Yes, in case of an API that does not plan and test, if the offered classes are copyable, that warning would give a hint.


2)
The warnings annihilate the boost noncopyable-idiom

In how far do the warnings annihilate boost::noncopyable? The only issue I see is that the workaround (declaring private, undefined functions) and boost::noncopyable express the same thing, so using them both is redundant.

The problem is, existing code using the boost idiom (or in another way relying on the feature that one uncopyable member prevents the whole class from being copyable) is forced to use the latter way, so making the derivation from boost::noncopyable obsolete. That means: We would break existing code that uses a quasi-standard idiom or - as Thorsten described it - just a known language feature.

I think: If one writes APIs and thinks he needs these warnings, switch them on explicitely in the affected modules. But I do not want to break existing code that uses a widely accepted idiom with a warning that for non-API code provides no information.

Nikolai

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to