diff --git a/src/config.cpp b/src/config.cpp index e289417c4c8..d11639e1349 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -209,6 +209,22 @@ config& config::operator=(const config& cfg) return *this; } +#ifdef HAVE_CXX0X +config::config(config &&cfg): + values(std::move(cfg.values)), + children(std::move(cfg.children)), + ordered_children(std::move(cfg.ordered_children)) +{ +} + +config &config::operator=(config &&cfg) +{ + clear(); + swap(cfg); + return *this; +} +#endif + bool config::has_attribute(const std::string &key) const { check_valid(); diff --git a/src/config.hpp b/src/config.hpp index d3e62d11fb8..b2807d2c298 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -79,7 +79,13 @@ public: // Create an empty node. config(); - config(const config& cfg); + config(const config &); + config &operator=(const config &); + +#ifdef HAVE_CXX0X + config(config &&); + config &operator=(config &&); +#endif /** * Creates a config object with an empty child of name @a child. @@ -88,7 +94,6 @@ public: ~config(); - config& operator=(const config& cfg); #ifdef HAVE_CXX0X explicit operator bool() const