diff --git a/doc/00_optional.qbk b/doc/00_optional.qbk index 6b41c88..1c8d59b 100644 --- a/doc/00_optional.qbk +++ b/doc/00_optional.qbk @@ -28,6 +28,7 @@ Distributed under the Boost Software License, Version 1.0. [def __OPTIONAL_POINTEE__ [@../../../utility/OptionalPointee.html `OptionalPointee`]] [def __COPY_CONSTRUCTIBLE__ [@../../../utility/CopyConstructible.html `CopyConstructible`]] +[def __MOVE_CONSTRUCTIBLE__ `MoveConstructible`] [def __FUNCTION_EQUAL_POINTEES__ [@../../../utility/OptionalPointee.html#equal `equal_pointees()`]] [def __FUNCTION_LESS_POINTEES__ [@../../../utility/OptionalPointee.html#less `less_pointees()`]] diff --git a/doc/18_type_requirements.qbk b/doc/18_type_requirements.qbk index 6faae48..033a6eb 100644 --- a/doc/18_type_requirements.qbk +++ b/doc/18_type_requirements.qbk @@ -13,12 +13,12 @@ But this is practically useless. In order for `optional` to be able to do any optional o; o.emplace("T", "ctor", "params"); -If `T` is `MoveConstructible`, `optional` is also `MoveConstructible` and can be easily initialized from an rvalue of type `T` and be passed by value: +If `T` is __MOVE_CONSTRUCTIBLE__, `optional` is also __MOVE_CONSTRUCTIBLE__ and can be easily initialized from an rvalue of type `T` and be passed by value: optional o = make_T(); optional p = optional(); -If `T` is `CopyConstructible`, `optional` is also `CopyConstructible` and can be easily initialized from an lvalue of type `T`: +If `T` is __COPY_CONSTRUCTIBLE__, `optional` is also __COPY_CONSTRUCTIBLE__ and can be easily initialized from an lvalue of type `T`: T v = make_T(); optional o = v; @@ -29,9 +29,9 @@ If `T` is not `MoveAssignable`, it is still possible to reset the value of `opti optional o = make_T(); o.emplace(make_another_T()); -If `T` is `Moveable` (both `MoveConstructible` and `MoveAssignable`) then `optional` is also `Moveable` and additionally can be constructed and assigned from an rvalue of type `T`. +If `T` is `Moveable` (both __MOVE_CONSTRUCTIBLE__ and `MoveAssignable`) then `optional` is also `Moveable` and additionally can be constructed and assigned from an rvalue of type `T`. -Similarly, if `T` is `Copyable` (both `CopyConstructible` and `CopyAssignable`) then `optional` is also `Copyable` and additionally can be constructed and assigned from an lvalue of type `T`. +Similarly, if `T` is `Copyable` (both __COPY_CONSTRUCTIBLE__ and `CopyAssignable`) then `optional` is also `Copyable` and additionally can be constructed and assigned from an lvalue of type `T`. `T` ['is not] required to be __SGI_DEFAULT_CONSTRUCTIBLE__. diff --git a/doc/20_reference.qbk b/doc/20_reference.qbk index bac369a..3a6330e 100644 --- a/doc/20_reference.qbk +++ b/doc/20_reference.qbk @@ -80,7 +80,7 @@ T&& value() && ; ``[link reference_optional_value __GO_TO__]`` template T value_or( U && v ) const& ; ``[link reference_optional_value_or __GO_TO__]`` - template T value_or( U && v ) && ; ``[link reference_optional_value_or __GO_TO__]`` + template T value_or( U && v ) && ; ``[link reference_optional_value_or_move __GO_TO__]`` T const* get_ptr() const ; ``[link reference_optional_get_ptr __GO_TO__]`` T* get_ptr() ; ``[link reference_optional_get_ptr __GO_TO__]`` @@ -761,7 +761,7 @@ __SPACE__ of type `T` with `std::forward(args)...`. * [*Postconditions: ] `*this` is [_initialized]. * [*Throws:] Whatever the selected `T`'s constructor throws. -* [*Notes:] `T` need not be `MoveConstructible` or `MoveAssignable`. On compilers that do not support variadic templates, the signature falls back to single-argument: `template void emplace(Arg&& arg)`. On compilers that do not support rvalue references, the signature falls back to two overloads: taking `const` and non-`const` lvalue reference. +* [*Notes:] `T` need not be __MOVE_CONSTRUCTIBLE__ or `MoveAssignable`. On compilers that do not support variadic templates, the signature falls back to single-argument: `template void emplace(Arg&& arg)`. On compilers that do not support rvalue references, the signature falls back to two overloads: taking `const` and non-`const` lvalue reference. * [*Exception Safety:] If an exception is thrown during the initialization of `T`, `*this` is ['uninitialized]. * [*Example:] `` @@ -906,12 +906,22 @@ __SPACE__ [#reference_optional_value_or] [: `template T optional::value_or(U && v) const& ;`] -[: `template T optional::value_or(U && v) && ;`] * [*Requires:] `T` is __COPY_CONSTRUCTIBLE__ and `U &&` is convertible to `T`. -* [*Returns:] First overload: `bool(*this) ? **this : static_cast(forward(v))`. second overload: `bool(*this) ? std::move(**this) : static_cast(forward(v))`. +* [*Returns:] `bool(*this) ? **this : static_cast(forward(v))`. * [*Throws:] Any exception thrown by the selected constructor of `T`. -* [*Notes:] On compilers that do not support ref-qualifiers on member functions these three overloads are replaced with the classical two: a `const` and non-`const` member functions. On compilers without rvalue reference support the type of `v` becomes `U const&`. +* [*Notes:] On compilers that do not support ref-qualifiers on member functions this overload is replaced with the `const`-qualified member function. On compilers without rvalue reference support the type of `v` becomes `U const&`. + +__SPACE__ + +[#reference_optional_value_or_move] + +[: `template T optional::value_or(U && v) && ;`] + +* [*Requires:] `T` is __MOVE_CONSTRUCTIBLE__ and `U &&` is convertible to `T`. +* [*Returns:] `bool(*this) ? std::move(**this) : static_cast(forward(v))`. +* [*Throws:] Any exception thrown by the selected constructor of `T`. +* [*Notes:] On compilers that do not support ref-qualifiers on member functions this overload is replaced with the classical non-`const`-qualified member function. On compilers without rvalue reference support the type of `v` becomes `U const&`. __SPACE__ diff --git a/doc/html/boost_optional/reference/detailed_semantics.html b/doc/html/boost_optional/reference/detailed_semantics.html index 21aebff..23c6745 100644 --- a/doc/html/boost_optional/reference/detailed_semantics.html +++ b/doc/html/boost_optional/reference/detailed_semantics.html @@ -1400,11 +1400,6 @@ const& ;

-

- template<class U> T optional<T>::value_or(U && - v) - && ; -

  • Requires: T @@ -1412,8 +1407,7 @@ is convertible to T.
  • - Returns: First overload: bool(*this) ? **this - : static_cast<T>(forward<U>(v)). second overload: bool(*this) ? std::move(**this) : static_cast<T>(forward<U>(v)). + Returns: bool(*this) ? **this : static_cast<T>(forward<U>(v)).
  • Throws: Any exception thrown by the @@ -1421,13 +1415,42 @@
  • Notes: On compilers that do not support - ref-qualifiers on member functions these three overloads are replaced - with the classical two: a const - and non-const member functions. + ref-qualifiers on member functions this overload is replaced with the + const-qualified member function. On compilers without rvalue reference support the type of v becomes U const&.
+

+ space +

+

+ template<class U> T optional<T>::value_or(U && + v) + && ; +

+
    +
  • + Requires: T + is MoveConstructible + and U && + is convertible to T. +
  • +
  • + Returns: bool(*this) ? std::move(**this) : static_cast<T>(forward<U>(v)). +
  • +
  • + Throws: Any exception thrown by the + selected constructor of T. +
  • +
  • + Notes: On compilers that do not support + ref-qualifiers on member functions this overload is replaced with the + classical non-const-qualified + member function. On compilers without rvalue reference support the type + of v becomes U const&. +
  • +

space

diff --git a/doc/html/boost_optional/tutorial/type_requirements.html b/doc/html/boost_optional/tutorial/type_requirements.html index 775e7bb..38a106d 100644 --- a/doc/html/boost_optional/tutorial/type_requirements.html +++ b/doc/html/boost_optional/tutorial/type_requirements.html @@ -60,10 +60,9 @@ optional<T> p = optional<T>();

- If T is CopyConstructible, - optional<T> is - also CopyConstructible and - can be easily initialized from an lvalue of type T: + If T is CopyConstructible, optional<T> is + also CopyConstructible + and can be easily initialized from an lvalue of type T:

T v = make_T();
 optional<T> o = v;
@@ -85,10 +84,8 @@
         can be constructed and assigned from an rvalue of type T.
       

- Similarly, if T is Copyable (both CopyConstructible - and CopyAssignable) then - optional<T> is - also Copyable and additionally + Similarly, if T is Copyable (both CopyConstructible and CopyAssignable) then optional<T> + is also Copyable and additionally can be constructed and assigned from an lvalue of type T.

diff --git a/doc/html/index.html b/doc/html/index.html index 4495d9b..a96a8b8 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -133,7 +133,7 @@ - +

Last revised: June 14, 2014 at 20:46:55 GMT

Last revised: June 16, 2014 at 12:04:51 GMT


diff --git a/doc/html/optional/reference.html b/doc/html/optional/reference.html index 9ec144c..0ab1183 100644 --- a/doc/html/optional/reference.html +++ b/doc/html/optional/reference.html @@ -104,7 +104,7 @@ T&& value() && ; R template<class U> T value_or( U && v ) const& ; R - template<class U> T value_or( U && v ) && ; R + template<class U> T value_or( U && v ) && ; R T const* get_ptr() const ; R T* get_ptr() ; R