Adds noexcept specifier to move special members of xpath_node_set, xpath_variable_set and xpath_query, but not of xml_document as ist has a throwing implementation

This commit is contained in:
Brandl, Matthäus (MBR) 2018-02-27 17:12:27 +01:00
parent 3cf8d7d70a
commit f43c2e1959
2 changed files with 20 additions and 20 deletions

View File

@ -7591,7 +7591,7 @@ PUGI__NS_BEGIN
_root_size = state._root_size; _root_size = state._root_size;
} }
void release() void release() PUGIXML_NOEXCEPT
{ {
xpath_memory_block* cur = _root; xpath_memory_block* cur = _root;
assert(cur); assert(cur);
@ -8613,13 +8613,13 @@ PUGI__NS_BEGIN
} }
} }
template <typename T> PUGI__FN void delete_xpath_variable(T* var) template <typename T> PUGI__FN void delete_xpath_variable(T* var) PUGIXML_NOEXCEPT
{ {
var->~T(); var->~T();
xml_memory::deallocate(var); xml_memory::deallocate(var);
} }
PUGI__FN void delete_xpath_variable(xpath_value_type type, xpath_variable* var) PUGI__FN void delete_xpath_variable(xpath_value_type type, xpath_variable* var) PUGIXML_NOEXCEPT
{ {
switch (type) switch (type)
{ {
@ -11872,7 +11872,7 @@ PUGI__NS_BEGIN
return new (memory) xpath_query_impl(); return new (memory) xpath_query_impl();
} }
static void destroy(xpath_query_impl* impl) static void destroy(xpath_query_impl* impl) PUGIXML_NOEXCEPT
{ {
// free all allocated pages // free all allocated pages
impl->alloc.release(); impl->alloc.release();
@ -12040,7 +12040,7 @@ namespace pugi
} }
#ifdef PUGIXML_HAS_MOVE #ifdef PUGIXML_HAS_MOVE
PUGI__FN void xpath_node_set::_move(xpath_node_set& rhs) PUGI__FN void xpath_node_set::_move(xpath_node_set& rhs) PUGIXML_NOEXCEPT
{ {
_type = rhs._type; _type = rhs._type;
_storage = rhs._storage; _storage = rhs._storage;
@ -12083,12 +12083,12 @@ namespace pugi
} }
#ifdef PUGIXML_HAS_MOVE #ifdef PUGIXML_HAS_MOVE
PUGI__FN xpath_node_set::xpath_node_set(xpath_node_set&& rhs): _type(type_unsorted), _begin(&_storage), _end(&_storage) PUGI__FN xpath_node_set::xpath_node_set(xpath_node_set&& rhs) PUGIXML_NOEXCEPT: _type(type_unsorted), _begin(&_storage), _end(&_storage)
{ {
_move(rhs); _move(rhs);
} }
PUGI__FN xpath_node_set& xpath_node_set::operator=(xpath_node_set&& rhs) PUGI__FN xpath_node_set& xpath_node_set::operator=(xpath_node_set&& rhs) PUGIXML_NOEXCEPT
{ {
if (this == &rhs) return *this; if (this == &rhs) return *this;
@ -12283,7 +12283,7 @@ namespace pugi
} }
#ifdef PUGIXML_HAS_MOVE #ifdef PUGIXML_HAS_MOVE
PUGI__FN xpath_variable_set::xpath_variable_set(xpath_variable_set&& rhs) PUGI__FN xpath_variable_set::xpath_variable_set(xpath_variable_set&& rhs) PUGIXML_NOEXCEPT
{ {
for (size_t i = 0; i < sizeof(_data) / sizeof(_data[0]); ++i) for (size_t i = 0; i < sizeof(_data) / sizeof(_data[0]); ++i)
{ {
@ -12292,7 +12292,7 @@ namespace pugi
} }
} }
PUGI__FN xpath_variable_set& xpath_variable_set::operator=(xpath_variable_set&& rhs) PUGI__FN xpath_variable_set& xpath_variable_set::operator=(xpath_variable_set&& rhs) PUGIXML_NOEXCEPT
{ {
for (size_t i = 0; i < sizeof(_data) / sizeof(_data[0]); ++i) for (size_t i = 0; i < sizeof(_data) / sizeof(_data[0]); ++i)
{ {
@ -12368,7 +12368,7 @@ namespace pugi
return true; return true;
} }
PUGI__FN void xpath_variable_set::_destroy(xpath_variable* var) PUGI__FN void xpath_variable_set::_destroy(xpath_variable* var) PUGIXML_NOEXCEPT
{ {
while (var) while (var)
{ {
@ -12486,7 +12486,7 @@ namespace pugi
} }
#ifdef PUGIXML_HAS_MOVE #ifdef PUGIXML_HAS_MOVE
PUGI__FN xpath_query::xpath_query(xpath_query&& rhs) PUGI__FN xpath_query::xpath_query(xpath_query&& rhs) PUGIXML_NOEXCEPT
{ {
_impl = rhs._impl; _impl = rhs._impl;
_result = rhs._result; _result = rhs._result;
@ -12494,7 +12494,7 @@ namespace pugi
rhs._result = xpath_parse_result(); rhs._result = xpath_parse_result();
} }
PUGI__FN xpath_query& xpath_query::operator=(xpath_query&& rhs) PUGI__FN xpath_query& xpath_query::operator=(xpath_query&& rhs) PUGIXML_NOEXCEPT
{ {
if (this == &rhs) return *this; if (this == &rhs) return *this;

View File

@ -1136,7 +1136,7 @@ namespace pugi
xpath_variable* _find(const char_t* name) const; xpath_variable* _find(const char_t* name) const;
static bool _clone(xpath_variable* var, xpath_variable** out_result); static bool _clone(xpath_variable* var, xpath_variable** out_result);
static void _destroy(xpath_variable* var); static void _destroy(xpath_variable* var) PUGIXML_NOEXCEPT;
public: public:
// Default constructor/destructor // Default constructor/destructor
@ -1149,8 +1149,8 @@ namespace pugi
#ifdef PUGIXML_HAS_MOVE #ifdef PUGIXML_HAS_MOVE
// Move semantics support // Move semantics support
xpath_variable_set(xpath_variable_set&& rhs); xpath_variable_set(xpath_variable_set&& rhs) PUGIXML_NOEXCEPT;
xpath_variable_set& operator=(xpath_variable_set&& rhs); xpath_variable_set& operator=(xpath_variable_set&& rhs) PUGIXML_NOEXCEPT;
#endif #endif
// Add a new variable or get the existing one, if the types match // Add a new variable or get the existing one, if the types match
@ -1193,8 +1193,8 @@ namespace pugi
#ifdef PUGIXML_HAS_MOVE #ifdef PUGIXML_HAS_MOVE
// Move semantics support // Move semantics support
xpath_query(xpath_query&& rhs); xpath_query(xpath_query&& rhs) PUGIXML_NOEXCEPT;
xpath_query& operator=(xpath_query&& rhs); xpath_query& operator=(xpath_query&& rhs) PUGIXML_NOEXCEPT;
#endif #endif
// Get query expression return type // Get query expression return type
@ -1334,8 +1334,8 @@ namespace pugi
#ifdef PUGIXML_HAS_MOVE #ifdef PUGIXML_HAS_MOVE
// Move semantics support // Move semantics support
xpath_node_set(xpath_node_set&& rhs); xpath_node_set(xpath_node_set&& rhs) PUGIXML_NOEXCEPT;
xpath_node_set& operator=(xpath_node_set&& rhs); xpath_node_set& operator=(xpath_node_set&& rhs) PUGIXML_NOEXCEPT;
#endif #endif
// Get collection type // Get collection type
@ -1369,7 +1369,7 @@ namespace pugi
xpath_node* _end; xpath_node* _end;
void _assign(const_iterator begin, const_iterator end, type_t type); void _assign(const_iterator begin, const_iterator end, type_t type);
void _move(xpath_node_set& rhs); void _move(xpath_node_set& rhs) PUGIXML_NOEXCEPT;
}; };
#endif #endif