Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-05-25 15:27:46


At 07:36 AM 5/26/00 +1200, Mark Rodgers wrote:

> ...
>
>But I could write
>
> struct fred : private noninstantiable { static void bar(){} };
> foo<fred>();
>
> ...
>
>However, I find it hard to imagine what harm would come from
>instantiating fred above, so wonder why we need to take the
>trouble to prevent it.

An argument in favor might be that a programmer instantiating fred is
probably misunderstanding it, so there is a benefit to letting the
programmer know the usage is amiss. It might make the intent of fred
clearer to a human reader, too.

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk