Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2004-02-26 10:11:32

In message <001901c3fc77$64c7cf70$1d00a8c0_at_pdimov2>, Peter Dimov
<pdimov_at_[hidden]> writes
>Kevlin Henney wrote:
>> I outlined in a previous email the intended syntax for use. To break
>> this would be more than a little inconvenient, and certainly against
>> the spirit of its design. Making the constructor 'explicit' would
>> break the compilation of other code that is quite reasonable --
>> perhaps not yours, because you are following the style I outlined as
>> an alternative in a previous response -- but it would still break it
>> and for no good reason, eg
>> std::map<std::string, boost::any> table;
>> ...
>> table[key] = 0; // reasonable usage
>This use case does not need an implicit constructor, just a templated

It was the spirit and sense of the expression rather than specifically
the mechanism that I was referring to -- boost::any currently achieves
this through a templated assignment operator. There was an implied
(in)consistency that I should perhaps have stressed more clearly.


   Kevlin Henney                   phone:  +44 117 942 2990
   mailto:kevlin_at_[hidden]     mobile: +44 7801 073 508        fax:    +44 870 052 2289
   Curbralan: Consultancy + Training + Development + Review

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