void
CfgOptionDef::copyTo(CfgOptionDef& new_config) const {
+ // Remove any existing option definitions from the destination.
+ new_config.option_definitions_.clearItems();
const std::list<std::string>& names =
option_definitions_.getOptionSpaceNames();
for (std::list<std::string>::const_iterator name = names.begin();
/// to an object passed as parameter. There are no shared objects or
/// pointers between the original object and a copy.
///
- /// @warning This function doesn't perform a cleanup of the @c new_config
- /// before copying the new configuration into it. It is caller's
- /// responsibility to make sure that this object doesn't contain any
- /// garbage data.
- ///
/// @param [out] new_config An object to which the configuration will be
/// copied.
void copyTo(CfgOptionDef& new_config) const;