
On Mon, 24 Jul 2006 17:36:49 -0400, "Chris Weed" <chrisweed@gmail.com> wrote:
It can be difficult to understand the difference between if_ and eval_if. If I derive get_value_type from nonconstructible, this would not have compiled.
Regardless of what originally motivated it, nonconstructible (I'd prefer non_constructible, or non_instantiatable) is neither more nor less useful as noncopyable (note: I won't reply to aggressive follow-ups on this... resource management and all that). Some years ago I proposed a simple syntactical addition to mark member functions as "not defined", in the class declaration (typically copy constructors and copy assignment operators), so that a diagnostic could be immediately emitted on anything that needed their definition (rather than processing *all* the TUs to see if a definition existed somewhere). At that time it was mostly ignored, but I see that many of the ideas raised in newsgroups years ago are being reprised by prominent members of the committee, and have wide acceptance. So it could be that someone would grab that one too. To go back to your solution, I'd add a base class having a private copy constructor, so that "self-initialization" M m = m; would be inhibited as well. Keep it in your personal toolbox ;-) -- [ Gennaro Prota, C++ developer. For hire ]