Boost logo

Boost :

Subject: Re: [boost] [poly_collection] throws upon insertion
From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2017-05-09 11:05:53


El 09/05/2017 a las 10:14, Andrzej Krzemienski via Boost escribió:
> Thanks for the explanation. I get it now. Could I suggest some
> rewording of
> the description of insert. Maybe first define something like 'ad-hoc
> registration':
>
> 'ad-hoc registration' of a reference `t` of a static type `T` into
>> collection `c` is defined as follows:
>> * If the dynamic type of `t` is already registered in `c`: nothing,
>> otherwise
>> * if the dynamic type of `t` is `T` and `T` is acceptable in `c`:
>> registers `T`, otherwise
>> * throws exception of type `unregistered_type`.
>>
> Then in the effects clause of `insert` just use it:
>
> Effects: performs ad-hoc registration of `t` into `*this`. Then, If `t` is
>> not a ...
>>

Thanks for the suggestion, I'll write something along that line.
("Dynamic type" can't be used
as the reference is common to all types of collections, and only
base_collection really uses
dynamic_cast).

Joaquín M López Muñoz


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