Permalink
Browse files

+ swap patch from @joto : http://www.remote.org/jochen/tmp/swap.patch

  • Loading branch information...
artemp committed Dec 20, 2012
1 parent 6590225 commit 6512d2873a5f83e3e598d384abae4437d8a4b461
Showing with 19 additions and 18 deletions.
  1. +2 −2 include/mapnik/layer.hpp
  2. +17 −16 src/layer.cpp
View
@@ -47,7 +47,7 @@ class MAPNIK_DECL layer
std::string const& srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs");
layer(layer const& l);
- layer& operator=(layer const& l);
+ layer& operator=(layer const& rhs);
bool operator==(layer const& other) const;
/*!
@@ -197,7 +197,7 @@ class MAPNIK_DECL layer
int buffer_size() const;
~layer();
private:
- void swap(const layer& other);
+ void swap(layer& other);
std::string name_;
std::string srs_;
View
@@ -58,7 +58,7 @@ layer::layer(const layer& rhs)
buffer_size_(rhs.buffer_size_),
maximum_extent_(rhs.maximum_extent_) {}
-layer& layer::operator=(const layer& rhs)
+layer& layer::operator=(layer const& rhs)
{
layer tmp(rhs);
swap(tmp);
@@ -70,21 +70,22 @@ bool layer::operator==(layer const& other) const
return (this == &other);
}
-void layer::swap(const layer& rhs)
-{
- name_=rhs.name_;
- srs_ = rhs.srs_;
- min_zoom_=rhs.min_zoom_;
- max_zoom_=rhs.max_zoom_;
- active_=rhs.active_;
- queryable_=rhs.queryable_;
- clear_label_cache_ = rhs.clear_label_cache_;
- cache_features_ = rhs.cache_features_;
- group_by_ = rhs.group_by_;
- styles_=rhs.styles_;
- ds_=rhs.ds_;
- buffer_size_ = rhs.buffer_size_;
- maximum_extent_ = rhs.maximum_extent_;
+void layer::swap(layer& rhs)
+{
+ using std::swap;
+ swap(name_, rhs.name_);
+ swap(srs_, rhs.srs_);
+ swap(min_zoom_, rhs.min_zoom_);
+ swap(max_zoom_, rhs.max_zoom_);
+ swap(active_, rhs.active_);
+ swap(queryable_, rhs.queryable_);
+ swap(clear_label_cache_, rhs.clear_label_cache_);
+ swap(cache_features_, rhs.cache_features_);
+ swap(group_by_, rhs.group_by_);
+ swap(styles_, rhs.styles_);
+ swap(ds_, rhs.ds_);
+ swap(buffer_size_, rhs.buffer_size_);
+ swap(maximum_extent_, rhs.maximum_extent_);
}
layer::~layer() {}

0 comments on commit 6512d28

Please sign in to comment.