mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
fix trivial constructor declaration
This commit is contained in:
parent
1bce2b4a5b
commit
478c476611
16 changed files with 89 additions and 69 deletions
|
@ -39,7 +39,7 @@ namespace sprout {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
SPROUT_CONSTEXPR xor8(xor8 const&) = default;
|
xor8(xor8 const&) = default;
|
||||||
explicit SPROUT_CONSTEXPR xor8(sum_type sum)
|
explicit SPROUT_CONSTEXPR xor8(sum_type sum)
|
||||||
: sum_(sum)
|
: sum_(sum)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR complex(T const& re = T(), T const& im = T()) SPROUT_NOEXCEPT
|
SPROUT_CONSTEXPR complex(T const& re = T(), T const& im = T()) SPROUT_NOEXCEPT
|
||||||
: re_(re), im_(im)
|
: re_(re), im_(im)
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR complex(complex const&) = default;
|
complex(complex const&) = default;
|
||||||
template<typename X>
|
template<typename X>
|
||||||
SPROUT_CONSTEXPR complex(complex<X> const& other) SPROUT_NOEXCEPT
|
SPROUT_CONSTEXPR complex(complex<X> const& other) SPROUT_NOEXCEPT
|
||||||
: re_(other.real()), im_(other.imag())
|
: re_(other.real()), im_(other.imag())
|
||||||
|
@ -44,66 +44,70 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR T real() const SPROUT_NOEXCEPT {
|
SPROUT_CONSTEXPR T real() const SPROUT_NOEXCEPT {
|
||||||
return re_;
|
return re_;
|
||||||
}
|
}
|
||||||
void real(T re) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR void real(T re) SPROUT_NOEXCEPT {
|
||||||
re_ = re;
|
re_ = re;
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR T imag() const SPROUT_NOEXCEPT {
|
SPROUT_CONSTEXPR T imag() const SPROUT_NOEXCEPT {
|
||||||
return im_;
|
return im_;
|
||||||
}
|
}
|
||||||
void imag(T im) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR void imag(T im) SPROUT_NOEXCEPT {
|
||||||
im_ = im;
|
im_ = im;
|
||||||
}
|
}
|
||||||
complex& operator=(T const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator=(T const& rhs) SPROUT_NOEXCEPT {
|
||||||
re_ = rhs;
|
re_ = rhs;
|
||||||
im_ = T();
|
im_ = T();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
complex& operator+=(T const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator+=(T const& rhs) SPROUT_NOEXCEPT {
|
||||||
re_ += rhs;
|
re_ += rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
complex& operator-=(T const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator-=(T const& rhs) SPROUT_NOEXCEPT {
|
||||||
re_ -= rhs;
|
re_ -= rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
complex& operator*=(T const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator*=(T const& rhs) SPROUT_NOEXCEPT {
|
||||||
re_ *= rhs;
|
re_ *= rhs;
|
||||||
im_ *= rhs;
|
im_ *= rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
complex& operator/=(T const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator/=(T const& rhs) SPROUT_NOEXCEPT {
|
||||||
re_ /= rhs;
|
re_ /= rhs;
|
||||||
im_ /= rhs;
|
im_ /= rhs;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
complex& operator=(complex const&) = default;
|
SPROUT_CXX14_CONSTEXPR complex& operator=(complex const& rhs) SPROUT_NOEXCEPT {
|
||||||
template<typename X>
|
|
||||||
complex& operator=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
|
||||||
re_ = rhs.real();
|
re_ = rhs.real();
|
||||||
im_ = rhs.imag();
|
im_ = rhs.imag();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
template<typename X>
|
template<typename X>
|
||||||
complex& operator+=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
||||||
|
re_ = rhs.real();
|
||||||
|
im_ = rhs.imag();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
template<typename X>
|
||||||
|
SPROUT_CXX14_CONSTEXPR complex& operator+=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
||||||
re_ += rhs.real();
|
re_ += rhs.real();
|
||||||
im_ += rhs.imag();
|
im_ += rhs.imag();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
template<typename X>
|
template<typename X>
|
||||||
complex& operator-=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator-=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
||||||
re_ -= rhs.real();
|
re_ -= rhs.real();
|
||||||
im_ -= rhs.imag();
|
im_ -= rhs.imag();
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
template<typename X>
|
template<typename X>
|
||||||
complex& operator*=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator*=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
||||||
return *this = complex(
|
return *this = complex(
|
||||||
re_ * rhs.real() - im_ * rhs.imag(),
|
re_ * rhs.real() - im_ * rhs.imag(),
|
||||||
re_ * rhs.imag() + im_ * rhs.real()
|
re_ * rhs.imag() + im_ * rhs.real()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
template<typename X>
|
template<typename X>
|
||||||
complex& operator/=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR complex& operator/=(complex<X> const& rhs) SPROUT_NOEXCEPT {
|
||||||
T n = sprout::detail::complex_norm(rhs);
|
T n = sprout::detail::complex_norm(rhs);
|
||||||
return *this = complex(
|
return *this = complex(
|
||||||
(re_ * rhs.real() + im_ * rhs.imag()) / n,
|
(re_ * rhs.real() + im_ * rhs.imag()) / n,
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace sprout {
|
||||||
explicit SPROUT_CONSTEXPR container_holder(param_type x)
|
explicit SPROUT_CONSTEXPR container_holder(param_type x)
|
||||||
: container(x)
|
: container(x)
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR container_holder(container_holder const&) = default;
|
container_holder(container_holder const&) = default;
|
||||||
|
|
||||||
void swap(container_holder& other)
|
void swap(container_holder& other)
|
||||||
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(other.container, container)))
|
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(other.container, container)))
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR uniform_color()
|
SPROUT_CONSTEXPR uniform_color()
|
||||||
: 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)
|
explicit SPROUT_CONSTEXPR uniform_color(color_type const& color)
|
||||||
: color_(color)
|
: color_(color)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -175,7 +175,7 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR whitted_style()
|
SPROUT_CONSTEXPR whitted_style()
|
||||||
: infinity_color_()
|
: 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)
|
explicit SPROUT_CONSTEXPR whitted_style(infinity_color_type const& infinity_color)
|
||||||
: infinity_color_(infinity_color)
|
: infinity_color_(infinity_color)
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -222,7 +222,7 @@ namespace sprout {
|
||||||
holder_type val;
|
holder_type val;
|
||||||
item_holder_type next;
|
item_holder_type next;
|
||||||
private:
|
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)
|
SPROUT_CONSTEXPR item(typename holder_type::argument_type p, item_holder_type const& n)
|
||||||
: val(p)
|
: val(p)
|
||||||
, next(n)
|
, next(n)
|
||||||
|
@ -259,7 +259,6 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR item() SPROUT_NOEXCEPT
|
SPROUT_CONSTEXPR item() SPROUT_NOEXCEPT
|
||||||
: val(), next()
|
: val(), next()
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR item(item&&) = default;
|
|
||||||
SPROUT_CONSTEXPR item(typename holder_type::argument_type p)
|
SPROUT_CONSTEXPR item(typename holder_type::argument_type p)
|
||||||
: val(p)
|
: val(p)
|
||||||
, next()
|
, next()
|
||||||
|
@ -324,7 +323,9 @@ namespace sprout {
|
||||||
p = &(*p)->next;
|
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) {
|
SPROUT_CXX14_CONSTEXPR forward_clist& operator=(forward_clist&& x) {
|
||||||
fst = sprout::move(x.fst);
|
fst = sprout::move(x.fst);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace sprout {
|
||||||
explicit SPROUT_CONSTEXPR back_insert_iterator(param_type x)
|
explicit SPROUT_CONSTEXPR back_insert_iterator(param_type x)
|
||||||
: base_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) {
|
SPROUT_CXX14_CONSTEXPR back_insert_iterator& operator=(typename container_type::value_type const& value) {
|
||||||
container->push_back(value);
|
container->push_back(value);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace sprout {
|
||||||
explicit SPROUT_CONSTEXPR front_insert_iterator(param_type x)
|
explicit SPROUT_CONSTEXPR front_insert_iterator(param_type x)
|
||||||
: base_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) {
|
SPROUT_CXX14_CONSTEXPR front_insert_iterator& operator=(typename container_type::value_type const& value) {
|
||||||
container->push_front(value);
|
container->push_front(value);
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR insert_iterator(param_type x, iterator pos)
|
SPROUT_CONSTEXPR insert_iterator(param_type x, iterator pos)
|
||||||
: base_type(x), iter(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 {
|
SPROUT_CONSTEXPR iterator position() const {
|
||||||
return iter;
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ namespace sprout {
|
||||||
bool init;
|
bool init;
|
||||||
holder_type val;
|
holder_type val;
|
||||||
private:
|
private:
|
||||||
void destroy() SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR void destroy() SPROUT_NOEXCEPT {
|
||||||
init = false;
|
init = false;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
@ -106,7 +106,7 @@ namespace sprout {
|
||||||
, val(v.is_initialized() ? holder_type(*v) : holder_type())
|
, val(v.is_initialized() ? holder_type(*v) : holder_type())
|
||||||
{}
|
{}
|
||||||
#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ <= 1))
|
#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && __GNUC_PATCHLEVEL__ <= 1))
|
||||||
SPROUT_CONSTEXPR optional(optional&&) = default;
|
optional(optional&&) = default;
|
||||||
#else
|
#else
|
||||||
SPROUT_CONSTEXPR optional(optional&& v)
|
SPROUT_CONSTEXPR optional(optional&& v)
|
||||||
SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_constructible<T>::value)
|
SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_constructible<T>::value)
|
||||||
|
@ -159,15 +159,15 @@ namespace sprout {
|
||||||
, val(v.is_initialized() ? holder_type(sprout::move(optional<U>::get(v))) : holder_type())
|
, val(v.is_initialized() ? holder_type(sprout::move(optional<U>::get(v))) : holder_type())
|
||||||
{}
|
{}
|
||||||
// 20.6.4.3, assignment
|
// 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);
|
assign(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
optional& operator=(optional const& v) {
|
SPROUT_CXX14_CONSTEXPR optional& operator=(optional const& v) {
|
||||||
assign(v);
|
assign(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
optional& operator=(optional&& v)
|
SPROUT_CXX14_CONSTEXPR optional& operator=(optional&& v)
|
||||||
SPROUT_NOEXCEPT_EXPR(std::is_move_constructible<T>::value && std::is_move_assignable<T>::value)
|
SPROUT_NOEXCEPT_EXPR(std::is_move_constructible<T>::value && std::is_move_assignable<T>::value)
|
||||||
{
|
{
|
||||||
assign(sprout::forward<optional>(v));
|
assign(sprout::forward<optional>(v));
|
||||||
|
@ -178,17 +178,17 @@ namespace sprout {
|
||||||
// typename = typename std::enable_if<std::is_constructible<T, U>::value && std::is_assignable<U, T>::value>::type
|
// typename = typename std::enable_if<std::is_constructible<T, U>::value && std::is_assignable<U, T>::value>::type
|
||||||
typename = typename std::enable_if<std::is_constructible<T, U&&>::value>::type
|
typename = typename std::enable_if<std::is_constructible<T, U&&>::value>::type
|
||||||
>
|
>
|
||||||
optional& operator=(U&& v) {
|
SPROUT_CXX14_CONSTEXPR optional& operator=(U&& v) {
|
||||||
assign(sprout::forward<U>(v));
|
assign(sprout::forward<U>(v));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
template<typename U>
|
template<typename U>
|
||||||
optional& operator=(optional<U> const& v) {
|
SPROUT_CXX14_CONSTEXPR optional& operator=(optional<U> const& v) {
|
||||||
assign(v);
|
assign(v);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
template<typename U>
|
template<typename U>
|
||||||
optional& operator=(optional<U>&& v) {
|
SPROUT_CXX14_CONSTEXPR optional& operator=(optional<U>&& v) {
|
||||||
assign(sprout::forward<optional<U> >(v));
|
assign(sprout::forward<optional<U> >(v));
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ namespace sprout {
|
||||||
typename... Args,
|
typename... Args,
|
||||||
typename = typename std::enable_if<is_constructible_args<Args...>::value>::type
|
typename = typename std::enable_if<is_constructible_args<Args...>::value>::type
|
||||||
>
|
>
|
||||||
void emplace(Args&&... args) {
|
SPROUT_CXX14_CONSTEXPR void emplace(Args&&... args) {
|
||||||
optional temp(sprout::in_place, sprout::forward<Args>(args)...);
|
optional temp(sprout::in_place, sprout::forward<Args>(args)...);
|
||||||
temp.swap(*this);
|
temp.swap(*this);
|
||||||
}
|
}
|
||||||
|
@ -205,19 +205,19 @@ namespace sprout {
|
||||||
typename U, typename... Args,
|
typename U, typename... Args,
|
||||||
typename = typename std::enable_if<is_constructible_args<std::initializer_list<U>&, Args...>::value>::type
|
typename = typename std::enable_if<is_constructible_args<std::initializer_list<U>&, Args...>::value>::type
|
||||||
>
|
>
|
||||||
void emplace(std::initializer_list<U> il, Args&&... args) {
|
SPROUT_CXX14_CONSTEXPR void emplace(std::initializer_list<U> il, Args&&... args) {
|
||||||
optional temp(sprout::in_place, il, sprout::forward<Args>(args)...);
|
optional temp(sprout::in_place, il, sprout::forward<Args>(args)...);
|
||||||
temp.swap(*this);
|
temp.swap(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void assign(sprout::nullopt_t) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR void assign(sprout::nullopt_t) SPROUT_NOEXCEPT {
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
void assign(optional const& v) {
|
void assign(optional const& v) {
|
||||||
optional temp(v);
|
optional temp(v);
|
||||||
temp.swap(*this);
|
temp.swap(*this);
|
||||||
}
|
}
|
||||||
void assign(optional&& v)
|
SPROUT_CXX14_CONSTEXPR void assign(optional&& v)
|
||||||
SPROUT_NOEXCEPT_EXPR(std::is_move_constructible<T>::value && std::is_move_assignable<T>::value)
|
SPROUT_NOEXCEPT_EXPR(std::is_move_constructible<T>::value && std::is_move_assignable<T>::value)
|
||||||
{
|
{
|
||||||
optional temp(sprout::forward<optional>(v));
|
optional temp(sprout::forward<optional>(v));
|
||||||
|
@ -228,25 +228,25 @@ namespace sprout {
|
||||||
// typename = typename std::enable_if<std::is_constructible<T, U>::value && std::is_assignable<U, T>::value>::type
|
// typename = typename std::enable_if<std::is_constructible<T, U>::value && std::is_assignable<U, T>::value>::type
|
||||||
typename = typename std::enable_if<std::is_constructible<T, U&&>::value>::type
|
typename = typename std::enable_if<std::is_constructible<T, U&&>::value>::type
|
||||||
>
|
>
|
||||||
void assign(U&& v) {
|
SPROUT_CXX14_CONSTEXPR void assign(U&& v) {
|
||||||
optional temp(sprout::forward<U>(v));
|
optional temp(sprout::forward<U>(v));
|
||||||
temp.swap(*this);
|
temp.swap(*this);
|
||||||
}
|
}
|
||||||
template<typename U>
|
template<typename U>
|
||||||
void assign(optional<U> const& v) {
|
SPROUT_CXX14_CONSTEXPR void assign(optional<U> const& v) {
|
||||||
optional temp(v);
|
optional temp(v);
|
||||||
temp.swap(*this);
|
temp.swap(*this);
|
||||||
}
|
}
|
||||||
template<typename U>
|
template<typename U>
|
||||||
void assign(optional<U>&& v) {
|
SPROUT_CXX14_CONSTEXPR void assign(optional<U>&& v) {
|
||||||
optional temp(sprout::forward<optional<U> >(v));
|
optional temp(sprout::forward<optional<U> >(v));
|
||||||
temp.swap(*this);
|
temp.swap(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset() SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR void reset() SPROUT_NOEXCEPT {
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
void reset(sprout::nullopt_t v) SPROUT_NOEXCEPT {
|
SPROUT_CXX14_CONSTEXPR void reset(sprout::nullopt_t v) SPROUT_NOEXCEPT {
|
||||||
assign(v);
|
assign(v);
|
||||||
}
|
}
|
||||||
template<
|
template<
|
||||||
|
@ -254,11 +254,11 @@ namespace sprout {
|
||||||
// typename = typename std::enable_if<std::is_constructible<T, U>::value && std::is_assignable<U, T>::value>::type
|
// typename = typename std::enable_if<std::is_constructible<T, U>::value && std::is_assignable<U, T>::value>::type
|
||||||
typename = typename std::enable_if<std::is_constructible<T, U&&>::value>::type
|
typename = typename std::enable_if<std::is_constructible<T, U&&>::value>::type
|
||||||
>
|
>
|
||||||
void reset(U&& v) {
|
SPROUT_CXX14_CONSTEXPR void reset(U&& v) {
|
||||||
assign(sprout::forward<U>(v));
|
assign(sprout::forward<U>(v));
|
||||||
}
|
}
|
||||||
// 20.6.4.4, swap
|
// 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_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::swap(val, other.val)))
|
||||||
{
|
{
|
||||||
sprout::swap(init, other.init);
|
sprout::swap(init, other.init);
|
||||||
|
@ -270,7 +270,7 @@ namespace sprout {
|
||||||
val.get_pointer()
|
val.get_pointer()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
pointer_type operator->() {
|
SPROUT_CXX14_CONSTEXPR pointer_type operator->() {
|
||||||
return SPROUT_ASSERT(is_initialized()),
|
return SPROUT_ASSERT(is_initialized()),
|
||||||
val.get_pointer()
|
val.get_pointer()
|
||||||
;
|
;
|
||||||
|
@ -280,7 +280,7 @@ namespace sprout {
|
||||||
: 0
|
: 0
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
pointer_type get_pointer() {
|
SPROUT_CXX14_CONSTEXPR pointer_type get_pointer() {
|
||||||
return is_initialized() ? val.get_pointer()
|
return is_initialized() ? val.get_pointer()
|
||||||
: 0
|
: 0
|
||||||
;
|
;
|
||||||
|
@ -288,7 +288,7 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR pointer_const_type get_ptr() const {
|
SPROUT_CONSTEXPR pointer_const_type get_ptr() const {
|
||||||
return get_pointer();
|
return get_pointer();
|
||||||
}
|
}
|
||||||
pointer_type get_ptr() {
|
SPROUT_CXX14_CONSTEXPR pointer_type get_ptr() {
|
||||||
return get_pointer();
|
return get_pointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ namespace sprout {
|
||||||
: val.get()
|
: val.get()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
reference_type operator*() {
|
SPROUT_CXX14_CONSTEXPR reference_type operator*() {
|
||||||
return (SPROUT_ASSERT(is_initialized()), true) ? val.get()
|
return (SPROUT_ASSERT(is_initialized()), true) ? val.get()
|
||||||
: val.get()
|
: val.get()
|
||||||
;
|
;
|
||||||
|
@ -305,7 +305,7 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR reference_const_type value() const {
|
SPROUT_CONSTEXPR reference_const_type value() const {
|
||||||
return get();
|
return get();
|
||||||
}
|
}
|
||||||
reference_type value() {
|
SPROUT_CXX14_CONSTEXPR reference_type value() {
|
||||||
return get();
|
return get();
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR reference_const_type get() const {
|
SPROUT_CONSTEXPR reference_const_type get() const {
|
||||||
|
@ -313,7 +313,7 @@ namespace sprout {
|
||||||
: (throw sprout::bad_optional_access("optional<>: bad optional access"), val.get())
|
: (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()
|
return is_initialized() ? val.get()
|
||||||
: (throw sprout::bad_optional_access("optional<>: bad optional access"), 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 {
|
SPROUT_CONSTEXPR reference_const_type value_or(reference_const_type& v) const {
|
||||||
return get_value_or(v);
|
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);
|
return get_value_or(v);
|
||||||
}
|
}
|
||||||
SPROUT_CONSTEXPR reference_const_type get_value_or(reference_const_type& v) const {
|
SPROUT_CONSTEXPR reference_const_type get_value_or(reference_const_type& v) const {
|
||||||
|
@ -330,7 +330,7 @@ namespace sprout {
|
||||||
: v
|
: 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()
|
return is_initialized() ? val.get()
|
||||||
: v
|
: v
|
||||||
;
|
;
|
||||||
|
@ -351,7 +351,7 @@ namespace sprout {
|
||||||
// swap
|
// swap
|
||||||
//
|
//
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline void
|
inline SPROUT_CXX14_CONSTEXPR void
|
||||||
swap(sprout::optional<T>& lhs, sprout::optional<T>& rhs)
|
swap(sprout::optional<T>& lhs, sprout::optional<T>& rhs)
|
||||||
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
|
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(lhs.swap(rhs)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -129,8 +129,8 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR basic_string_impl()
|
SPROUT_CONSTEXPR basic_string_impl()
|
||||||
: elems{}, len()
|
: elems{}, len()
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR basic_string_impl(basic_string_impl const&) = default;
|
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&&) = default;
|
||||||
template<typename String, sprout::index_t... Indexes>
|
template<typename String, sprout::index_t... Indexes>
|
||||||
SPROUT_CONSTEXPR basic_string_impl(
|
SPROUT_CONSTEXPR basic_string_impl(
|
||||||
sprout::index_tuple<Indexes...>,
|
sprout::index_tuple<Indexes...>,
|
||||||
|
@ -293,8 +293,8 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
// construct/copy/destroy:
|
// construct/copy/destroy:
|
||||||
SPROUT_CONSTEXPR basic_string() = default;
|
basic_string() = default;
|
||||||
SPROUT_CONSTEXPR basic_string(basic_string const&) = default;
|
basic_string(basic_string const&) = default;
|
||||||
template<std::size_t N2, typename Enable = typename std::enable_if<(N2 < N)>::type>
|
template<std::size_t N2, typename Enable = typename std::enable_if<(N2 < N)>::type>
|
||||||
SPROUT_CONSTEXPR basic_string(basic_string<T, N2, Traits> const& str)
|
SPROUT_CONSTEXPR basic_string(basic_string<T, N2, Traits> const& str)
|
||||||
: impl_type(
|
: impl_type(
|
||||||
|
|
|
@ -115,8 +115,8 @@ namespace sprout {
|
||||||
tuple_impl() = default;
|
tuple_impl() = default;
|
||||||
template<typename... UTypes>
|
template<typename... UTypes>
|
||||||
explicit SPROUT_CONSTEXPR tuple_impl(UTypes&&...) SPROUT_NOEXCEPT {}
|
explicit SPROUT_CONSTEXPR tuple_impl(UTypes&&...) SPROUT_NOEXCEPT {}
|
||||||
SPROUT_CONSTEXPR tuple_impl(tuple_impl const&) = default;
|
tuple_impl(tuple_impl const&) = default;
|
||||||
SPROUT_CONSTEXPR tuple_impl(tuple_impl&&) = default;
|
tuple_impl(tuple_impl&&) = default;
|
||||||
template<typename... UTypes>
|
template<typename... UTypes>
|
||||||
SPROUT_CONSTEXPR tuple_impl(tuple_impl<Index, UTypes...> const&) SPROUT_NOEXCEPT {}
|
SPROUT_CONSTEXPR tuple_impl(tuple_impl<Index, UTypes...> const&) SPROUT_NOEXCEPT {}
|
||||||
template<typename... UTypes>
|
template<typename... UTypes>
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/index_tuple/metafunction.hpp>
|
#include <sprout/index_tuple/metafunction.hpp>
|
||||||
#include <sprout/utility/forward.hpp>
|
#include <sprout/utility/forward.hpp>
|
||||||
#include <sprout/utility/swap.hpp>
|
|
||||||
#include <sprout/utility/pair/pair_decl.hpp>
|
#include <sprout/utility/pair/pair_decl.hpp>
|
||||||
#include <sprout/tuple/tuple/tuple.hpp>
|
#include <sprout/tuple/tuple/tuple.hpp>
|
||||||
#include <sprout/tuple/tuple/get.hpp>
|
#include <sprout/tuple/tuple/get.hpp>
|
||||||
|
|
|
@ -40,8 +40,8 @@ namespace sprout {
|
||||||
: first()
|
: first()
|
||||||
, second()
|
, second()
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR pair(pair const&) = default;
|
pair(pair const&) = default;
|
||||||
SPROUT_CONSTEXPR pair(pair&&) = default;
|
pair(pair&&) = default;
|
||||||
SPROUT_CONSTEXPR pair(T1 const& x, T2 const& y)
|
SPROUT_CONSTEXPR pair(T1 const& x, T2 const& y)
|
||||||
: first(x)
|
: first(x)
|
||||||
, second(y)
|
, second(y)
|
||||||
|
@ -102,7 +102,11 @@ namespace sprout {
|
||||||
>
|
>
|
||||||
SPROUT_CONSTEXPR pair(sprout::tuples::tuple<U, V>&& other);
|
SPROUT_CONSTEXPR pair(sprout::tuples::tuple<U, V>&& 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_CXX14_CONSTEXPR pair& operator=(pair&& rhs)
|
||||||
SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_assignable<T1>::value && std::is_nothrow_move_assignable<T2>::value)
|
SPROUT_NOEXCEPT_EXPR(std::is_nothrow_move_assignable<T1>::value && std::is_nothrow_move_assignable<T2>::value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -83,8 +83,12 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR basic_string_ref()
|
SPROUT_CONSTEXPR basic_string_ref()
|
||||||
: ptr_(0), len_(0)
|
: ptr_(0), len_(0)
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR basic_string_ref(basic_string_ref const& rhs) = default;
|
basic_string_ref(basic_string_ref const& rhs) = default;
|
||||||
basic_string_ref& operator=(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)
|
SPROUT_CONSTEXPR basic_string_ref(const_pointer str)
|
||||||
: ptr_(str), len_(traits_type::length(str))
|
: ptr_(str), len_(traits_type::length(str))
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -211,8 +211,8 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR value_holder()
|
SPROUT_CONSTEXPR value_holder()
|
||||||
: holder_()
|
: holder_()
|
||||||
{}
|
{}
|
||||||
SPROUT_CONSTEXPR value_holder(value_holder const&) = default;
|
value_holder(value_holder const&) = default;
|
||||||
SPROUT_CONSTEXPR value_holder(value_holder&&) = default;
|
value_holder(value_holder&&) = default;
|
||||||
explicit SPROUT_CONSTEXPR value_holder(argument_type p)
|
explicit SPROUT_CONSTEXPR value_holder(argument_type p)
|
||||||
: holder_(helper_type::hold(p))
|
: holder_(helper_type::hold(p))
|
||||||
{}
|
{}
|
||||||
|
@ -234,8 +234,16 @@ namespace sprout {
|
||||||
: holder_(il, sprout::forward<Args>(args)...)
|
: holder_(il, sprout::forward<Args>(args)...)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
value_holder& operator=(value_holder const&) = default;
|
SPROUT_CXX14_CONSTEXPR value_holder& operator=(value_holder const& rhs) {
|
||||||
value_holder& operator=(value_holder&&) = default;
|
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) {
|
SPROUT_CXX14_CONSTEXPR value_holder& operator=(argument_type p) {
|
||||||
value_holder temp(p);
|
value_holder temp(p);
|
||||||
temp.swap(*this);
|
temp.swap(*this);
|
||||||
|
|
Loading…
Reference in a new issue