From 478c476611b8b51fb2684c27c490c42b784e844a Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Tue, 29 Oct 2013 19:15:52 +0900 Subject: [PATCH] fix trivial constructor declaration --- sprout/checksum/xor.hpp | 2 +- sprout/complex/complex.hpp | 34 ++++++------ sprout/container/container_holder.hpp | 2 +- sprout/darkroom/renderers/infinity.hpp | 2 +- sprout/darkroom/renderers/whitted_style.hpp | 2 +- sprout/forward_clist.hpp | 7 +-- sprout/iterator/back_insert_iterator.hpp | 2 +- sprout/iterator/front_insert_iterator.hpp | 2 +- sprout/iterator/insert_iterator.hpp | 2 +- sprout/optional/optional.hpp | 56 ++++++++++---------- sprout/string/string.hpp | 8 +-- sprout/tuple/tuple/tuple_decl.hpp | 4 +- sprout/utility/pair/pair.hpp | 1 - sprout/utility/pair/pair_decl.hpp | 10 ++-- sprout/utility/string_ref/string_ref.hpp | 8 ++- sprout/utility/value_holder/value_holder.hpp | 16 ++++-- 16 files changed, 89 insertions(+), 69 deletions(-) diff --git a/sprout/checksum/xor.hpp b/sprout/checksum/xor.hpp index 98ad64a0..98a67901 100644 --- a/sprout/checksum/xor.hpp +++ b/sprout/checksum/xor.hpp @@ -39,7 +39,7 @@ namespace sprout { ); } public: - SPROUT_CONSTEXPR xor8(xor8 const&) = default; + xor8(xor8 const&) = default; explicit SPROUT_CONSTEXPR xor8(sum_type sum) : sum_(sum) {} diff --git a/sprout/complex/complex.hpp b/sprout/complex/complex.hpp index f7e64bdb..b62cf157 100644 --- a/sprout/complex/complex.hpp +++ b/sprout/complex/complex.hpp @@ -36,7 +36,7 @@ namespace sprout { SPROUT_CONSTEXPR complex(T const& re = T(), T const& im = T()) SPROUT_NOEXCEPT : re_(re), im_(im) {} - SPROUT_CONSTEXPR complex(complex const&) = default; + complex(complex const&) = default; template SPROUT_CONSTEXPR complex(complex const& other) SPROUT_NOEXCEPT : re_(other.real()), im_(other.imag()) @@ -44,66 +44,70 @@ namespace sprout { SPROUT_CONSTEXPR T real() const SPROUT_NOEXCEPT { return re_; } - void real(T re) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR void real(T re) SPROUT_NOEXCEPT { re_ = re; } SPROUT_CONSTEXPR T imag() const SPROUT_NOEXCEPT { return im_; } - void imag(T im) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR void imag(T im) SPROUT_NOEXCEPT { im_ = im; } - complex& operator=(T const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator=(T const& rhs) SPROUT_NOEXCEPT { re_ = rhs; im_ = T(); return *this; } - complex& operator+=(T const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator+=(T const& rhs) SPROUT_NOEXCEPT { re_ += rhs; return *this; } - complex& operator-=(T const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator-=(T const& rhs) SPROUT_NOEXCEPT { re_ -= rhs; return *this; } - complex& operator*=(T const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator*=(T const& rhs) SPROUT_NOEXCEPT { re_ *= rhs; im_ *= rhs; return *this; } - complex& operator/=(T const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator/=(T const& rhs) SPROUT_NOEXCEPT { re_ /= rhs; im_ /= rhs; return *this; } - complex& operator=(complex const&) = default; - template - complex& operator=(complex const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator=(complex const& rhs) SPROUT_NOEXCEPT { re_ = rhs.real(); im_ = rhs.imag(); return *this; } template - complex& operator+=(complex const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator=(complex const& rhs) SPROUT_NOEXCEPT { + re_ = rhs.real(); + im_ = rhs.imag(); + return *this; + } + template + SPROUT_CXX14_CONSTEXPR complex& operator+=(complex const& rhs) SPROUT_NOEXCEPT { re_ += rhs.real(); im_ += rhs.imag(); return *this; } template - complex& operator-=(complex const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator-=(complex const& rhs) SPROUT_NOEXCEPT { re_ -= rhs.real(); im_ -= rhs.imag(); return *this; } template - complex& operator*=(complex const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator*=(complex const& rhs) SPROUT_NOEXCEPT { return *this = complex( re_ * rhs.real() - im_ * rhs.imag(), re_ * rhs.imag() + im_ * rhs.real() ); } template - complex& operator/=(complex const& rhs) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR complex& operator/=(complex const& rhs) SPROUT_NOEXCEPT { T n = sprout::detail::complex_norm(rhs); return *this = complex( (re_ * rhs.real() + im_ * rhs.imag()) / n, diff --git a/sprout/container/container_holder.hpp b/sprout/container/container_holder.hpp index 37e3e30f..3764262e 100644 --- a/sprout/container/container_holder.hpp +++ b/sprout/container/container_holder.hpp @@ -50,7 +50,7 @@ namespace sprout { explicit SPROUT_CONSTEXPR container_holder(param_type x) : container(x) {} - SPROUT_CONSTEXPR container_holder(container_holder const&) = default; + container_holder(container_holder const&) = default; void swap(container_holder& other) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(other.container, container))) diff --git a/sprout/darkroom/renderers/infinity.hpp b/sprout/darkroom/renderers/infinity.hpp index 8fe97566..db23bdab 100644 --- a/sprout/darkroom/renderers/infinity.hpp +++ b/sprout/darkroom/renderers/infinity.hpp @@ -62,7 +62,7 @@ namespace sprout { SPROUT_CONSTEXPR uniform_color() : color_() {} - SPROUT_CONSTEXPR uniform_color(uniform_color const&) = default; + uniform_color(uniform_color const&) = default; explicit SPROUT_CONSTEXPR uniform_color(color_type const& color) : color_(color) {} diff --git a/sprout/darkroom/renderers/whitted_style.hpp b/sprout/darkroom/renderers/whitted_style.hpp index 88e3037f..bd486246 100644 --- a/sprout/darkroom/renderers/whitted_style.hpp +++ b/sprout/darkroom/renderers/whitted_style.hpp @@ -175,7 +175,7 @@ namespace sprout { SPROUT_CONSTEXPR whitted_style() : infinity_color_() {} - SPROUT_CONSTEXPR whitted_style(whitted_style const&) = default; + whitted_style(whitted_style const&) = default; explicit SPROUT_CONSTEXPR whitted_style(infinity_color_type const& infinity_color) : infinity_color_(infinity_color) {} diff --git a/sprout/forward_clist.hpp b/sprout/forward_clist.hpp index a7317061..9ac35e3b 100644 --- a/sprout/forward_clist.hpp +++ b/sprout/forward_clist.hpp @@ -222,7 +222,7 @@ namespace sprout { holder_type val; item_holder_type next; private: - SPROUT_CONSTEXPR item(item const&) = default; + item(item const&) = default; SPROUT_CONSTEXPR item(typename holder_type::argument_type p, item_holder_type const& n) : val(p) , next(n) @@ -259,7 +259,6 @@ namespace sprout { SPROUT_CONSTEXPR item() SPROUT_NOEXCEPT : val(), next() {} - SPROUT_CONSTEXPR item(item&&) = default; SPROUT_CONSTEXPR item(typename holder_type::argument_type p) : val(p) , next() @@ -324,7 +323,9 @@ namespace sprout { p = &(*p)->next; } } - SPROUT_CXX14_CONSTEXPR forward_clist(forward_clist&& x) = default; + SPROUT_CXX14_CONSTEXPR forward_clist(forward_clist&& x) + : fst(sprout::move(x.fst)) + {} SPROUT_CXX14_CONSTEXPR forward_clist& operator=(forward_clist&& x) { fst = sprout::move(x.fst); return *this; diff --git a/sprout/iterator/back_insert_iterator.hpp b/sprout/iterator/back_insert_iterator.hpp index f3e25ed8..73c22a7c 100644 --- a/sprout/iterator/back_insert_iterator.hpp +++ b/sprout/iterator/back_insert_iterator.hpp @@ -54,7 +54,7 @@ namespace sprout { explicit SPROUT_CONSTEXPR back_insert_iterator(param_type x) : base_type(x) {} - SPROUT_CONSTEXPR back_insert_iterator(back_insert_iterator const&) = default; + back_insert_iterator(back_insert_iterator const&) = default; SPROUT_CXX14_CONSTEXPR back_insert_iterator& operator=(typename container_type::value_type const& value) { container->push_back(value); return *this; diff --git a/sprout/iterator/front_insert_iterator.hpp b/sprout/iterator/front_insert_iterator.hpp index bffc7bdd..51d8c892 100644 --- a/sprout/iterator/front_insert_iterator.hpp +++ b/sprout/iterator/front_insert_iterator.hpp @@ -54,7 +54,7 @@ namespace sprout { explicit SPROUT_CONSTEXPR front_insert_iterator(param_type x) : base_type(x) {} - SPROUT_CONSTEXPR front_insert_iterator(front_insert_iterator const&) = default; + front_insert_iterator(front_insert_iterator const&) = default; SPROUT_CXX14_CONSTEXPR front_insert_iterator& operator=(typename container_type::value_type const& value) { container->push_front(value); return *this; diff --git a/sprout/iterator/insert_iterator.hpp b/sprout/iterator/insert_iterator.hpp index f6525e9c..560eb594 100644 --- a/sprout/iterator/insert_iterator.hpp +++ b/sprout/iterator/insert_iterator.hpp @@ -58,7 +58,7 @@ namespace sprout { SPROUT_CONSTEXPR insert_iterator(param_type x, iterator pos) : base_type(x), iter(pos) {} - SPROUT_CONSTEXPR insert_iterator(insert_iterator const&) = default; + insert_iterator(insert_iterator const&) = default; SPROUT_CONSTEXPR iterator position() const { return iter; } diff --git a/sprout/optional/optional.hpp b/sprout/optional/optional.hpp index b664f835..a5dadfb0 100644 --- a/sprout/optional/optional.hpp +++ b/sprout/optional/optional.hpp @@ -90,7 +90,7 @@ namespace sprout { bool init; holder_type val; private: - void destroy() SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR void destroy() SPROUT_NOEXCEPT { init = false; } public: @@ -106,7 +106,7 @@ namespace sprout { , val(v.is_initialized() ? holder_type(*v) : holder_type()) {} #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ <= 1)) - SPROUT_CONSTEXPR optional(optional&&) = default; + optional(optional&&) = default; #else SPROUT_CONSTEXPR optional(optional&& v) SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_constructible::value) @@ -159,15 +159,15 @@ namespace sprout { , val(v.is_initialized() ? holder_type(sprout::move(optional::get(v))) : holder_type()) {} // 20.6.4.3, assignment - optional& operator=(sprout::nullopt_t v) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR optional& operator=(sprout::nullopt_t v) SPROUT_NOEXCEPT { assign(v); return *this; } - optional& operator=(optional const& v) { + SPROUT_CXX14_CONSTEXPR optional& operator=(optional const& v) { assign(v); return *this; } - optional& operator=(optional&& v) + SPROUT_CXX14_CONSTEXPR optional& operator=(optional&& v) SPROUT_NOEXCEPT_EXPR(std::is_move_constructible::value && std::is_move_assignable::value) { assign(sprout::forward(v)); @@ -178,17 +178,17 @@ namespace sprout { // typename = typename std::enable_if::value && std::is_assignable::value>::type typename = typename std::enable_if::value>::type > - optional& operator=(U&& v) { + SPROUT_CXX14_CONSTEXPR optional& operator=(U&& v) { assign(sprout::forward(v)); return *this; } template - optional& operator=(optional const& v) { + SPROUT_CXX14_CONSTEXPR optional& operator=(optional const& v) { assign(v); return *this; } template - optional& operator=(optional&& v) { + SPROUT_CXX14_CONSTEXPR optional& operator=(optional&& v) { assign(sprout::forward >(v)); return *this; } @@ -197,7 +197,7 @@ namespace sprout { typename... Args, typename = typename std::enable_if::value>::type > - void emplace(Args&&... args) { + SPROUT_CXX14_CONSTEXPR void emplace(Args&&... args) { optional temp(sprout::in_place, sprout::forward(args)...); temp.swap(*this); } @@ -205,19 +205,19 @@ namespace sprout { typename U, typename... Args, typename = typename std::enable_if&, Args...>::value>::type > - void emplace(std::initializer_list il, Args&&... args) { + SPROUT_CXX14_CONSTEXPR void emplace(std::initializer_list il, Args&&... args) { optional temp(sprout::in_place, il, sprout::forward(args)...); temp.swap(*this); } - void assign(sprout::nullopt_t) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR void assign(sprout::nullopt_t) SPROUT_NOEXCEPT { destroy(); } void assign(optional const& v) { optional temp(v); temp.swap(*this); } - void assign(optional&& v) + SPROUT_CXX14_CONSTEXPR void assign(optional&& v) SPROUT_NOEXCEPT_EXPR(std::is_move_constructible::value && std::is_move_assignable::value) { optional temp(sprout::forward(v)); @@ -228,25 +228,25 @@ namespace sprout { // typename = typename std::enable_if::value && std::is_assignable::value>::type typename = typename std::enable_if::value>::type > - void assign(U&& v) { + SPROUT_CXX14_CONSTEXPR void assign(U&& v) { optional temp(sprout::forward(v)); temp.swap(*this); } template - void assign(optional const& v) { + SPROUT_CXX14_CONSTEXPR void assign(optional const& v) { optional temp(v); temp.swap(*this); } template - void assign(optional&& v) { + SPROUT_CXX14_CONSTEXPR void assign(optional&& v) { optional temp(sprout::forward >(v)); temp.swap(*this); } - void reset() SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR void reset() SPROUT_NOEXCEPT { destroy(); } - void reset(sprout::nullopt_t v) SPROUT_NOEXCEPT { + SPROUT_CXX14_CONSTEXPR void reset(sprout::nullopt_t v) SPROUT_NOEXCEPT { assign(v); } template< @@ -254,11 +254,11 @@ namespace sprout { // typename = typename std::enable_if::value && std::is_assignable::value>::type typename = typename std::enable_if::value>::type > - void reset(U&& v) { + SPROUT_CXX14_CONSTEXPR void reset(U&& v) { assign(sprout::forward(v)); } // 20.6.4.4, swap - void swap(optional& other) + SPROUT_CXX14_CONSTEXPR void swap(optional& other) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(val, other.val))) { sprout::swap(init, other.init); @@ -270,7 +270,7 @@ namespace sprout { val.get_pointer() ; } - pointer_type operator->() { + SPROUT_CXX14_CONSTEXPR pointer_type operator->() { return SPROUT_ASSERT(is_initialized()), val.get_pointer() ; @@ -280,7 +280,7 @@ namespace sprout { : 0 ; } - pointer_type get_pointer() { + SPROUT_CXX14_CONSTEXPR pointer_type get_pointer() { return is_initialized() ? val.get_pointer() : 0 ; @@ -288,7 +288,7 @@ namespace sprout { SPROUT_CONSTEXPR pointer_const_type get_ptr() const { return get_pointer(); } - pointer_type get_ptr() { + SPROUT_CXX14_CONSTEXPR pointer_type get_ptr() { return get_pointer(); } @@ -297,7 +297,7 @@ namespace sprout { : val.get() ; } - reference_type operator*() { + SPROUT_CXX14_CONSTEXPR reference_type operator*() { return (SPROUT_ASSERT(is_initialized()), true) ? val.get() : val.get() ; @@ -305,7 +305,7 @@ namespace sprout { SPROUT_CONSTEXPR reference_const_type value() const { return get(); } - reference_type value() { + SPROUT_CXX14_CONSTEXPR reference_type value() { return get(); } SPROUT_CONSTEXPR reference_const_type get() const { @@ -313,7 +313,7 @@ namespace sprout { : (throw sprout::bad_optional_access("optional<>: bad optional access"), val.get()) ; } - reference_type get() { + SPROUT_CXX14_CONSTEXPR reference_type get() { return is_initialized() ? val.get() : (throw sprout::bad_optional_access("optional<>: bad optional access"), val.get()) ; @@ -322,7 +322,7 @@ namespace sprout { SPROUT_CONSTEXPR reference_const_type value_or(reference_const_type& v) const { return get_value_or(v); } - reference_type value_or(reference_type& v) { + SPROUT_CXX14_CONSTEXPR reference_type value_or(reference_type& v) { return get_value_or(v); } SPROUT_CONSTEXPR reference_const_type get_value_or(reference_const_type& v) const { @@ -330,7 +330,7 @@ namespace sprout { : v ; } - reference_type get_value_or(reference_type& v) { + SPROUT_CXX14_CONSTEXPR reference_type get_value_or(reference_type& v) { return is_initialized() ? val.get() : v ; @@ -351,7 +351,7 @@ namespace sprout { // swap // template - inline void + inline SPROUT_CXX14_CONSTEXPR void swap(sprout::optional& lhs, sprout::optional& rhs) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs))) { diff --git a/sprout/string/string.hpp b/sprout/string/string.hpp index 673920ca..c7c43e80 100644 --- a/sprout/string/string.hpp +++ b/sprout/string/string.hpp @@ -129,8 +129,8 @@ namespace sprout { SPROUT_CONSTEXPR basic_string_impl() : elems{}, len() {} - SPROUT_CONSTEXPR basic_string_impl(basic_string_impl const&) = default; - SPROUT_CONSTEXPR basic_string_impl(basic_string_impl&&) SPROUT_NOEXCEPT = default; + basic_string_impl(basic_string_impl const&) = default; + basic_string_impl(basic_string_impl&&) = default; template SPROUT_CONSTEXPR basic_string_impl( sprout::index_tuple, @@ -293,8 +293,8 @@ namespace sprout { } public: // construct/copy/destroy: - SPROUT_CONSTEXPR basic_string() = default; - SPROUT_CONSTEXPR basic_string(basic_string const&) = default; + basic_string() = default; + basic_string(basic_string const&) = default; template::type> SPROUT_CONSTEXPR basic_string(basic_string const& str) : impl_type( diff --git a/sprout/tuple/tuple/tuple_decl.hpp b/sprout/tuple/tuple/tuple_decl.hpp index b46df3c6..90ce5624 100644 --- a/sprout/tuple/tuple/tuple_decl.hpp +++ b/sprout/tuple/tuple/tuple_decl.hpp @@ -115,8 +115,8 @@ namespace sprout { tuple_impl() = default; template explicit SPROUT_CONSTEXPR tuple_impl(UTypes&&...) SPROUT_NOEXCEPT {} - SPROUT_CONSTEXPR tuple_impl(tuple_impl const&) = default; - SPROUT_CONSTEXPR tuple_impl(tuple_impl&&) = default; + tuple_impl(tuple_impl const&) = default; + tuple_impl(tuple_impl&&) = default; template SPROUT_CONSTEXPR tuple_impl(tuple_impl const&) SPROUT_NOEXCEPT {} template diff --git a/sprout/utility/pair/pair.hpp b/sprout/utility/pair/pair.hpp index db2ff7ba..15135a06 100644 --- a/sprout/utility/pair/pair.hpp +++ b/sprout/utility/pair/pair.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/sprout/utility/pair/pair_decl.hpp b/sprout/utility/pair/pair_decl.hpp index f0d72be5..86f15c1f 100644 --- a/sprout/utility/pair/pair_decl.hpp +++ b/sprout/utility/pair/pair_decl.hpp @@ -40,8 +40,8 @@ namespace sprout { : first() , second() {} - SPROUT_CONSTEXPR pair(pair const&) = default; - SPROUT_CONSTEXPR pair(pair&&) = default; + pair(pair const&) = default; + pair(pair&&) = default; SPROUT_CONSTEXPR pair(T1 const& x, T2 const& y) : first(x) , second(y) @@ -102,7 +102,11 @@ namespace sprout { > SPROUT_CONSTEXPR pair(sprout::tuples::tuple&& other); - pair& operator=(pair const& rhs) = default; + SPROUT_CXX14_CONSTEXPR pair& operator=(pair const& rhs) { + first = rhs.first; + second = rhs.second; + return *this; + } SPROUT_CXX14_CONSTEXPR pair& operator=(pair&& rhs) SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_assignable::value && std::is_nothrow_move_assignable::value) { diff --git a/sprout/utility/string_ref/string_ref.hpp b/sprout/utility/string_ref/string_ref.hpp index 8dd9e8c6..c402b2ad 100644 --- a/sprout/utility/string_ref/string_ref.hpp +++ b/sprout/utility/string_ref/string_ref.hpp @@ -83,8 +83,12 @@ namespace sprout { SPROUT_CONSTEXPR basic_string_ref() : ptr_(0), len_(0) {} - SPROUT_CONSTEXPR basic_string_ref(basic_string_ref const& rhs) = default; - basic_string_ref& operator=(basic_string_ref const& rhs) = default; + basic_string_ref(basic_string_ref const& rhs) = default; + SPROUT_CXX14_CONSTEXPR basic_string_ref& operator=(basic_string_ref const& rhs) { + basic_string_ref temp(rhs); + temp.swap(*this); + return *this; + } SPROUT_CONSTEXPR basic_string_ref(const_pointer str) : ptr_(str), len_(traits_type::length(str)) {} diff --git a/sprout/utility/value_holder/value_holder.hpp b/sprout/utility/value_holder/value_holder.hpp index d671dac0..245d2718 100644 --- a/sprout/utility/value_holder/value_holder.hpp +++ b/sprout/utility/value_holder/value_holder.hpp @@ -211,8 +211,8 @@ namespace sprout { SPROUT_CONSTEXPR value_holder() : holder_() {} - SPROUT_CONSTEXPR value_holder(value_holder const&) = default; - SPROUT_CONSTEXPR value_holder(value_holder&&) = default; + value_holder(value_holder const&) = default; + value_holder(value_holder&&) = default; explicit SPROUT_CONSTEXPR value_holder(argument_type p) : holder_(helper_type::hold(p)) {} @@ -234,8 +234,16 @@ namespace sprout { : holder_(il, sprout::forward(args)...) {} - value_holder& operator=(value_holder const&) = default; - value_holder& operator=(value_holder&&) = default; + SPROUT_CXX14_CONSTEXPR value_holder& operator=(value_holder const& rhs) { + value_holder temp(rhs); + temp.swap(*this); + return *this; + } + SPROUT_CXX14_CONSTEXPR value_holder& operator=(value_holder&& rhs) { + value_holder temp(sprout::move(rhs)); + temp.swap(*this); + return *this; + } SPROUT_CXX14_CONSTEXPR value_holder& operator=(argument_type p) { value_holder temp(p); temp.swap(*this);