2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-02-14 12:52:17 +00:00

Fixed exception specifications for value_holder

This commit is contained in:
ruben
2020-03-28 14:37:07 +00:00
parent 2327d84959
commit 69188a5a68
2 changed files with 8 additions and 2 deletions

View File

@@ -12,6 +12,8 @@ class async_handler_arg
error_info err_;
T value_;
public:
using value_type = T;
constexpr async_handler_arg() noexcept = default;
constexpr async_handler_arg(error_info&& info):

View File

@@ -2,6 +2,7 @@
#define INCLUDE_BOOST_MYSQL_DETAIL_PROTOCOL_VALUE_HOLDER_HPP_
#include <utility>
#include <type_traits>
namespace boost {
namespace mysql {
@@ -11,13 +12,16 @@ template <typename T>
struct value_holder
{
using value_type = T;
static_assert(std::is_nothrow_default_constructible_v<T>);
value_type value;
value_holder(): value{} {};
value_holder() noexcept: value{} {};
template <typename U>
explicit constexpr value_holder(U&& u): value(std::forward<U>(u)) {}
explicit constexpr value_holder(U&& u)
noexcept(std::is_nothrow_constructible_v<T, decltype(u)>):
value(std::forward<U>(u)) {}
constexpr bool operator==(const value_holder<T>& rhs) const { return value == rhs.value; }
constexpr bool operator!=(const value_holder<T>& rhs) const { return value != rhs.value; }