modify add_layer to work with both move and copy semantics

This commit is contained in:
artemp 2014-05-28 09:54:02 +01:00
parent 0fe172ec9e
commit a010195b36
3 changed files with 4 additions and 4 deletions

View file

@ -207,7 +207,7 @@ public:
/*! \brief Add a layer to the map.
* @param l The layer to add.
*/
void add_layer(layer const& l);
void add_layer(layer l);
/*! \brief Get a layer.
* @param index layer number.

View file

@ -723,7 +723,7 @@ void map_parser::parse_layer(Map & map, xml_node const& node)
}
}
}
map.add_layer(lyr);
map.add_layer(std::move(lyr));
}
catch (config_error const& ex)
{

View file

@ -251,9 +251,9 @@ size_t Map::layer_count() const
return layers_.size();
}
void Map::add_layer(layer const& l)
void Map::add_layer(layer l)
{
layers_.push_back(l);
layers_.push_back(std::move(l));
}
void Map::remove_layer(size_t index)