mapnik::Map - implement assignment-op in terms of swap
This commit is contained in:
parent
5083f3a30e
commit
6f81c88f9a
2 changed files with 3 additions and 18 deletions
|
@ -123,7 +123,7 @@ public:
|
|||
* TODO: to be documented
|
||||
*
|
||||
*/
|
||||
Map& operator=(Map const& rhs);
|
||||
Map& operator=(Map rhs);
|
||||
|
||||
/*! \brief Get all styles
|
||||
* @return Const reference to styles
|
||||
|
|
19
src/map.cpp
19
src/map.cpp
|
@ -101,24 +101,9 @@ Map::Map(Map const& rhs)
|
|||
|
||||
Map::~Map() {}
|
||||
|
||||
Map& Map::operator=(Map const& rhs)
|
||||
Map& Map::operator=(Map rhs)
|
||||
{
|
||||
if (this==&rhs) return *this;
|
||||
width_= rhs.width_;
|
||||
height_= rhs.height_;
|
||||
srs_ = rhs.srs_;
|
||||
buffer_size_ = rhs.buffer_size_;
|
||||
background_ = rhs.background_;
|
||||
background_image_ = rhs.background_image_;
|
||||
background_image_comp_op_ = rhs.background_image_comp_op_;
|
||||
background_image_opacity_ = rhs.background_image_opacity_;
|
||||
styles_ = rhs.styles_;
|
||||
fontsets_ = rhs.fontsets_;
|
||||
layers_ = rhs.layers_;
|
||||
aspectFixMode_ = rhs.aspectFixMode_;
|
||||
maximum_extent_ = rhs.maximum_extent_;
|
||||
base_path_ = rhs.base_path_;
|
||||
extra_params_ = rhs.extra_params_;
|
||||
std::swap(*this, rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue