git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: add noexcept to move constructors
commit47b98c2bb49bbbdcc49b2c977b8090934ecd8f73 authorAndy Arvanitis <andyarvanitis@gmail.com> dateSun 10 Jan 2016, 19:02 (11 years ago) parent120a22e
2 files changed+9−9
pcc/include/purescript.cc+2−2 pcc/include/purescript.hh+7−7
pcc/include/purescript.cc+2−2
@@ -56,7 +56,7 @@ any::any(const any& other) {
5656 copy_data(other);
5757}
5858
59−any::any(any&& other) {
59+any::any(any&& other) noexcept {
6060 move_data(other);
6161}
6262
@@ -71,7 +71,7 @@ auto any::operator=(any& rhs) -> any& {
7171 return *this;
7272}
7373
74−auto any::operator=(any&& rhs) -> any& {
74+auto any::operator=(any&& rhs) noexcept -> any& {
7575 move_data(rhs);
7676 return *this;
7777}
pcc/include/purescript.hh+7−7
@@ -82,7 +82,7 @@ class any {
8282 }
8383
8484 template <typename T>
85− static constexpr auto make_shared(T&& arg) -> shared<T> {
85+ static constexpr auto make_shared(T&& arg) noexcept -> shared<T> {
8686 return std::make_shared<T>(std::move(arg));
8787 }
8888
@@ -113,14 +113,14 @@ class any {
113113 any(const T val) : type(Type::Boolean), b(val) {}
114114
115115 any(const string& val) : type(Type::String), s(make_shared<string>(val)) {}
116− any(string&& val) : type(Type::String), s(make_shared<string>(std::move(val))) {}
116+ any(string&& val) noexcept : type(Type::String), s(make_shared<string>(std::move(val))) {}
117117 any(const char val[]) : type(Type::String), s(make_shared<string>(val)) {}
118118
119119 any(const map& val) : type(Type::Map), m(make_shared<map>(val)) {}
120− any(map&& val) : type(Type::Map), m(make_shared<map>(std::move(val))) {}
120+ any(map&& val) noexcept : type(Type::Map), m(make_shared<map>(std::move(val))) {}
121121
122122 any(const vector& val) : type(Type::Vector), v(make_shared<vector>(val)) {}
123− any(vector&& val) : type(Type::Vector), v(make_shared<vector>(std::move(val))) {}
123+ any(vector&& val) noexcept : type(Type::Vector), v(make_shared<vector>(std::move(val))) {}
124124
125125 template <typename T, typename = typename std::enable_if<!std::is_same<any,T>::value>::type>
126126 any(const T& val, typename std::enable_if<std::is_assignable<fn,T>::value>::type* = 0)
@@ -139,17 +139,17 @@ class any {
139139 : type(Type::Pointer), p(val) {}
140140
141141 template <typename T>
142− any(T&& val, typename std::enable_if<std::is_assignable<shared<void>,T>::value>::type* = 0)
142+ any(T&& val, typename std::enable_if<std::is_assignable<shared<void>,T>::value>::type* = 0) noexcept
143143 : type(Type::Pointer), p(std::move(val)) {}
144144
145145 any(std::nullptr_t) : type(Type::Pointer), p(nullptr) {}
146146
147147 any(const any&);
148− any(any&&);
148+ any(any&&) noexcept;
149149
150150 auto operator=(const any&) -> any&;
151151 auto operator=(any&) -> any&;
152− auto operator=(any&&) -> any&;
152+ auto operator=(any&&) noexcept -> any&;
153153
154154 any() = delete;
155155 ~any();