modify add_layer to work with both move and copy semantics
This commit is contained in:
parent
0fe172ec9e
commit
a010195b36
3 changed files with 4 additions and 4 deletions
|
@ -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.
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue