Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2001-05-02 08:05:47

At 01:20 PM 5/1/01 -0400, Doug Gregor wrote:
>> I think this is the least bad option. Most operator()'s are const, and
>> the case where the function object has _only_ a non-const operator(), a
>> dummy const version (that throws an exception) will have to be added by

>> user.
>It strikes me as dangerous that we put off what is usually a compile-time

>check for const-correctness until run-time. However, I see no other way
>get both const and non-const versions working properly: using
>either virtual
>functions or type erasure, both const and non-const must be instantiated,
>even if const is invalid for a specific function object something must
>- but it has to be at run-time. Perhaps that is just the price of

What about declaring but not defining, to turn it into a link-time error?


Boost list run by bdawes at, gregod at, cpdaniel at, john at