From 5d89799d7e1bb1e6b5fa0b8aab0e1b7e46224047 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 9 Jul 2016 14:21:23 -0400 Subject: [PATCH] More fixes, oooh boy... --- single/sol/sol.hpp | 106 ++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index c4b366f2..a3207234 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2016-07-09 17:39:34.708320 UTC -// This header was generated with sol v2.9.0 (revision ac5f13c) +// Generated 2016-07-09 18:21:00.184953 UTC +// This header was generated with sol v2.9.0 (revision c6b47c8) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -747,8 +747,8 @@ namespace sol { #else // beginning of Optional\optional.hpp -# ifndef ___SOL2_OPTIONAL_HPP___ -# define ___SOL2_OPTIONAL_HPP___ +# ifndef ___SOL_OPTIONAL_HPP___ +# define ___SOL_OPTIONAL_HPP___ # include # include @@ -847,8 +847,8 @@ namespace sol{ # elif defined TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS // leave it: the user doesn't want it # else - template - using is_trivially_destructible = std::has_trivial_destructor; + template + using is_trivially_destructible = ::std::has_trivial_destructor; # endif # if (defined TR2_OPTIONAL_GCC_4_7_AND_HIGHER___) @@ -864,7 +864,7 @@ namespace sol{ template struct is_nothrow_move_constructible { - constexpr static bool value = std::is_nothrow_constructible::value; + constexpr static bool value = ::std::is_nothrow_constructible::value; }; template @@ -873,7 +873,7 @@ struct is_assignable template constexpr static bool has_assign(...) { return false; } - template () = std::declval(), true)) > + template () = ::std::declval(), true)) > // the comma operator is necessary for the cases where operator= returns void constexpr static bool has_assign(bool) { return true; } @@ -890,7 +890,7 @@ struct is_nothrow_move_assignable template struct has_nothrow_move_assign { - constexpr static bool value = noexcept( std::declval() = std::declval() ); + constexpr static bool value = noexcept( ::std::declval() = ::std::declval() ); }; constexpr static bool value = has_nothrow_move_assign::value>::value; @@ -948,11 +948,11 @@ constexpr T* static_addressof(T& ref) template )> T* static_addressof(T& ref) { - return std::addressof(ref); + return ::std::addressof(ref); } template -U convert(U v) { return v; } +constexpr U convert(U v) { return v; } } // namespace detail @@ -969,8 +969,8 @@ constexpr nullopt_t nullopt{nullopt_t::init()}; class bad_optional_access : public ::std::logic_error { public: - explicit bad_optional_access(const ::std::string& what_arg) : logic_error{what_arg} {} - explicit bad_optional_access(const char* what_arg) : logic_error{what_arg} {} + explicit bad_optional_access(const ::std::string& what_arg) : ::std::logic_error{what_arg} {} + explicit bad_optional_access(const char* what_arg) : ::std::logic_error{what_arg} {} }; template @@ -1016,9 +1016,9 @@ struct optional_base template explicit optional_base(in_place_t, Args&&... args) : init_(true), storage_(constexpr_forward(args)...) {} - template >)> - explicit optional_base(in_place_t, std::initializer_list il, Args&&... args) - : init_(true), storage_(il, std::forward(args)...) {} + template >)> + explicit optional_base(in_place_t, ::std::initializer_list il, Args&&... args) + : init_(true), storage_(il, ::std::forward(args)...) {} ~optional_base() { if (init_) storage_.value_.T::~T(); } }; @@ -1038,38 +1038,38 @@ struct constexpr_optional_base template explicit constexpr constexpr_optional_base(in_place_t, Args&&... args) : init_(true), storage_(constexpr_forward(args)...) {} - template >)> - OPTIONAL_CONSTEXPR_INIT_LIST explicit constexpr_optional_base(in_place_t, std::initializer_list il, Args&&... args) - : init_(true), storage_(il, std::forward(args)...) {} + template >)> + OPTIONAL_CONSTEXPR_INIT_LIST explicit constexpr_optional_base(in_place_t, ::std::initializer_list il, Args&&... args) + : init_(true), storage_(il, ::std::forward(args)...) {} ~constexpr_optional_base() = default; }; template -using OptionalBase = typename std::conditional< - ::std::is_trivially_destructible::value, - constexpr_optional_base, - optional_base +using OptionalBase = typename ::std::conditional< + ::std::is_trivially_destructible::value, + constexpr_optional_base::type>, + optional_base::type> >::type; template class optional : private OptionalBase { - static_assert( !std::is_same::type, nullopt_t>::value, "bad T" ); - static_assert( !std::is_same::type, in_place_t>::value, "bad T" ); + static_assert( !::std::is_same::type, nullopt_t>::value, "bad T" ); + static_assert( !::std::is_same::type, in_place_t>::value, "bad T" ); constexpr bool initialized() const noexcept { return OptionalBase::init_; } - T* dataptr() { return std::addressof(OptionalBase::storage_.value_); } + typename ::std::remove_const::type* dataptr() { return ::std::addressof(OptionalBase::storage_.value_); } constexpr const T* dataptr() const { return detail_::static_addressof(OptionalBase::storage_.value_); } # if OPTIONAL_HAS_THIS_RVALUE_REFS == 1 constexpr const T& contained_val() const& { return OptionalBase::storage_.value_; } # if OPTIONAL_HAS_MOVE_ACCESSORS == 1 - OPTIONAL_MUTABLE_CONSTEXPR T&& contained_val() && { return std::move(OptionalBase::storage_.value_); } + OPTIONAL_MUTABLE_CONSTEXPR T&& contained_val() && { return ::std::move(OptionalBase::storage_.value_); } OPTIONAL_MUTABLE_CONSTEXPR T& contained_val() & { return OptionalBase::storage_.value_; } # else T& contained_val() & { return OptionalBase::storage_.value_; } - T&& contained_val() && { return std::move(OptionalBase::storage_.value_); } + T&& contained_val() && { return ::std::move(OptionalBase::storage_.value_); } # endif # else constexpr const T& contained_val() const { return OptionalBase::storage_.value_; } @@ -1104,13 +1104,6 @@ public: constexpr optional() noexcept : OptionalBase() {}; constexpr optional(nullopt_t) noexcept : OptionalBase() {}; - optional(const optional& rhs) : optional() { - if (rhs) { - ::new (static_cast(dataptr())) T(*rhs); - OptionalBase::init_ = true; - } - } - optional(const optional& rhs) : OptionalBase() { @@ -1120,11 +1113,19 @@ public: } } + optional(const optional& rhs) : optional() + { + if (rhs) { + ::new (static_cast(dataptr())) T(*rhs); + OptionalBase::init_ = true; + } + } + optional(optional&& rhs) noexcept(::std::is_nothrow_move_constructible::value) : OptionalBase() { if (rhs.initialized()) { - ::new (static_cast(dataptr())) T(std::move(*rhs)); + ::new (static_cast(dataptr())) T(::std::move(*rhs)); OptionalBase::init_ = true; } } @@ -1137,8 +1138,8 @@ public: explicit constexpr optional(in_place_t, Args&&... args) : OptionalBase(in_place_t{}, constexpr_forward(args)...) {} - template >)> - OPTIONAL_CONSTEXPR_INIT_LIST explicit optional(in_place_t, std::initializer_list il, Args&&... args) + template >)> + OPTIONAL_CONSTEXPR_INIT_LIST explicit optional(in_place_t, ::std::initializer_list il, Args&&... args) : OptionalBase(in_place_t{}, il, constexpr_forward(args)...) {} // 20.5.4.2, Destructor @@ -1163,8 +1164,8 @@ public: noexcept(::std::is_nothrow_move_assignable::value && ::std::is_nothrow_move_constructible::value) { if (initialized() == true && rhs.initialized() == false) clear(); - else if (initialized() == false && rhs.initialized() == true) initialize(std::move(*rhs)); - else if (initialized() == true && rhs.initialized() == true) contained_val() = std::move(*rhs); + else if (initialized() == false && rhs.initialized() == true) initialize(::std::move(*rhs)); + else if (initialized() == true && rhs.initialized() == true) contained_val() = ::std::move(*rhs); return *this; } @@ -1172,7 +1173,7 @@ public: auto operator=(U&& v) -> typename ::std::enable_if < - ::std::is_same::type, T>::value, + ::std::is_same::type, T>::value, optional& >::type { @@ -1192,11 +1193,11 @@ public: void emplace(::std::initializer_list il, Args&&... args) { clear(); - initialize(il, std::forward(args)...); + initialize(il, ::std::forward(args)...); } // 20.5.4.4, Swap - void swap(optional& rhs) noexcept(::std::is_nothrow_move_constructible::value && noexcept(::std::swap(::std::declval(), ::std::declval()))) + void swap(optional& rhs) noexcept(::std::is_nothrow_move_constructible::value && noexcept(swap(declval(), declval()))) { if (initialized() == true && rhs.initialized() == false) { rhs.initialize(::std::move(**this)); clear(); } else if (initialized() == false && rhs.initialized() == true) { initialize(::std::move(*rhs)); rhs.clear(); } @@ -1242,7 +1243,7 @@ public: OPTIONAL_MUTABLE_CONSTEXPR T&& value() && { if (!initialized()) throw bad_optional_access("bad optional access"); - return ::std::move(contained_val()); + return ::std::move(contained_val()); } # else @@ -1312,12 +1313,11 @@ public: template class optional { - static_assert( !std::is_same::value, "bad T" ); - static_assert( !std::is_same::value, "bad T" ); + static_assert( !::std::is_same::value, "bad T" ); + static_assert( !::std::is_same::value, "bad T" ); T* ref; public: - typedef T& value_type; // 20.5.5.1, construction/destruction constexpr optional() noexcept : ref(nullptr) {} @@ -1356,7 +1356,7 @@ public: auto operator=(U&& rhs) noexcept -> typename ::std::enable_if < - ::std::is_same::type, optional>::value, + ::std::is_same::type, optional>::value, optional& >::type { @@ -1404,7 +1404,7 @@ public: template constexpr typename ::std::decay::type value_or(V&& v) const { - return *this ? **this : detail_::convert::type>(constexpr_forward(v)); + return *this ? **this : detail_::convert::type>(constexpr_forward(v)); } }; @@ -1702,7 +1702,7 @@ constexpr optional make_optional(::std::reference_wrapper v) return optional(v.get()); } -} // namespace sol +} // namespace namespace std { @@ -1713,7 +1713,7 @@ namespace std typedef sol::optional argument_type; constexpr result_type operator()(argument_type const& arg) const { - return arg ? std::hash{}(*arg) : result_type{}; + return arg ? ::std::hash{}(*arg) : result_type{}; } }; @@ -1724,7 +1724,7 @@ namespace std typedef sol::optional argument_type; constexpr result_type operator()(argument_type const& arg) const { - return arg ? std::hash{}(*arg) : result_type{}; + return arg ? ::std::hash{}(*arg) : result_type{}; } }; } @@ -1732,7 +1732,7 @@ namespace std # undef TR2_OPTIONAL_REQUIRES # undef TR2_OPTIONAL_ASSERTED_EXPRESSION -# endif //___SOL2_OPTIONAL_HPP___ +# endif //___SOL_OPTIONAL_HPP___ // end of Optional\optional.hpp #endif // C++ 14