]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/ext/new_allocator.h
Relocation (= move+destroy)
[thirdparty/gcc.git] / libstdc++-v3 / include / ext / new_allocator.h
index 83c894ce0a778d70c6e287378dfa6cab5724cf41..18a45cd75f1089b470e8580fbfcf0db67dca4658 100644 (file)
@@ -142,11 +142,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       template<typename _Up, typename... _Args>
        void
        construct(_Up* __p, _Args&&... __args)
+       noexcept(noexcept(::new((void *)__p)
+                           _Up(std::forward<_Args>(__args)...)))
        { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
 
       template<typename _Up>
        void
-       destroy(_Up* __p) { __p->~_Up(); }
+       destroy(_Up* __p)
+       noexcept(noexcept( __p->~_Up()))
+       { __p->~_Up(); }
 #else
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
       // 402. wrong new expression in [some_] allocator::construct