Re: [Boost-users] [multi-index] possible extension
Joaquin, to be honest I did it also the way deriving from the boost::noncopyable and multi_index_container class. The only problem is the need of initializing constructors, which are either not available or must be explicitly overridden in the derived class. If standard containers are lacking this functionality it is not a reason to avoid it in a lib which stands for technology or ideas after standard containers. On the other hand I would like to point out that it is possible to specify a default policy of being copyable for a container. Only if someone wishes the container to be noncopyable she/he can/should specify it. There would be no change in the external interface for usage if the user is not aware of this feature. Best Regards, Ovanes.
On 9/21/07, Joaquin M Lopez Munoz
wrote: Hello Ovanes,
Ovanes Markarian
writes: Hello Joaquín,I would like to make a proposal for additional feature
optionaly making multi-index container non-copyable (via copying
of policy
class). The same way as a user can decide which indicies to use she/he could specify whether the new data-structure should be copyable or not. In my case I was assuming to pass container by reference, but it was copied by some function object. Which produced despite the performane issue wrong results. Using the non-copyable policy I would simply get a compiler error.
With all due respect, I don't think this is a feature worth including into the lib because:
1. All standard containers are copyable, I don't see any compelling reason to deviate from that. 2. The overlook you mention could have happened with almost any other kind of object, having this particular type patched makes little difference In the grand scheme of things.
Anyway, you can have your own noncopyable_multi_index_container by simply deriving from multi_index_container and providing the necessary forwading constructors (save copy, of course). Maybe this is sufficient for your needs.
Best,
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (1)
-
Ovanes Markarian