Add noexcept qualifier to swaps and moves.

This commit is contained in:
Tom Ritchford
2015-02-10 12:57:29 -05:00
parent 69b4cd22a2
commit a963a6d10d
11 changed files with 24 additions and 24 deletions

View File

@@ -42,7 +42,7 @@ Collection::~Collection ()
parent_->enabled_ = true;
}
Collection& Collection::operator= (Collection&& that)
Collection& Collection::operator= (Collection&& that) noexcept
{
parent_ = that.parent_;
writer_ = that.writer_;
@@ -55,7 +55,7 @@ Collection& Collection::operator= (Collection&& that)
return *this;
}
Collection::Collection (Collection&& that)
Collection::Collection (Collection&& that) noexcept
{
*this = std::move (that);
}

View File

@@ -151,8 +151,8 @@ namespace RPC {
class Collection
{
public:
Collection (Collection&& c);
Collection& operator= (Collection&& c);
Collection (Collection&& c) noexcept;
Collection& operator= (Collection&& c) noexcept;
Collection() = delete;
~Collection();
@@ -294,7 +294,7 @@ public:
}
#ifdef _MSC_VER
WriterObject (WriterObject&& other)
WriterObject (WriterObject&& other) noexcept
: writer_ (std::move (other.writer_)),
object_ (std::move (other.object_))
{

View File

@@ -220,12 +220,12 @@ Writer::~Writer()
impl_->finishAll ();
}
Writer::Writer(Writer&& w)
Writer::Writer(Writer&& w) noexcept
{
impl_ = std::move (w.impl_);
}
Writer& Writer::operator=(Writer&& w)
Writer& Writer::operator=(Writer&& w) noexcept
{
impl_ = std::move (w.impl_);
return *this;

View File

@@ -129,8 +129,8 @@ public:
enum CollectionType {array, object};
explicit Writer (Output const& output);
Writer(Writer&&);
Writer& operator=(Writer&&);
Writer(Writer&&) noexcept;
Writer& operator=(Writer&&) noexcept;
~Writer();