diff --git a/doc/html/boost_optional/a_note_about_optional_bool_.html b/doc/html/boost_optional/a_note_about_optional_bool_.html index 896994e..7434cf9 100644 --- a/doc/html/boost_optional/a_note_about_optional_bool_.html +++ b/doc/html/boost_optional/a_note_about_optional_bool_.html @@ -1,11 +1,11 @@ - + A note about optional<bool> - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

A note about optional<bool> @@ -70,7 +70,7 @@

-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/acknowledgments.html b/doc/html/boost_optional/acknowledgments.html index bd09f61..935ed0b 100644 --- a/doc/html/boost_optional/acknowledgments.html +++ b/doc/html/boost_optional/acknowledgments.html @@ -1,117 +1,117 @@ - + Acknowledgments - - + + - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHome +PrevUpHome
-
+

- + Pre-formal review

  • - Peter Dimov suggested the name 'optional', and was the first to point out - the need for aligned storage. -
  • + Peter Dimov suggested the name 'optional', and was the first to point out + the need for aligned storage. +
  • - Douglas Gregor developed 'type_with_alignment', and later Eric Friedman coded - 'aligned_storage', which are the core of the optional class implementation. -
  • + Douglas Gregor developed 'type_with_alignment', and later Eric Friedman + coded 'aligned_storage', which are the core of the optional class implementation. +
  • - Andrei Alexandrescu and Brian Parker also worked with aligned storage techniques - and their work influenced the current implementation. -
  • + Andrei Alexandrescu and Brian Parker also worked with aligned storage techniques + and their work influenced the current implementation. +
  • - Gennadiy Rozental made extensive and important comments which shaped the - design. -
  • + Gennadiy Rozental made extensive and important comments which shaped the + design. +
  • - Vesa Karvonen and Douglas Gregor made quite useful comparisons between optional, - variant and any; and made other relevant comments. -
  • + Vesa Karvonen and Douglas Gregor made quite useful comparisons between + optional, variant and any; and made other relevant comments. +
  • - Douglas Gregor and Peter Dimov commented on comparisons and evaluation in - boolean contexts. -
  • + Douglas Gregor and Peter Dimov commented on comparisons and evaluation + in boolean contexts. +
  • - Eric Friedman helped understand the issues involved with aligned storage, - move/copy operations and exception safety. -
  • + Eric Friedman helped understand the issues involved with aligned storage, + move/copy operations and exception safety. +
  • - Many others have participated with useful comments: Aleksey Gurotov, Kevlin - Henney, David Abrahams, and others I can't recall. -
  • + Many others have participated with useful comments: Aleksey Gurotov, Kevlin + Henney, David Abrahams, and others I can't recall. +

- + Post-formal review

  • - William Kempf carefully considered the originally proposed interface and - suggested the new interface which is currently used. He also started and - fueled the discussion about the analogy optional<>/smart pointer and - about relational operators. -
  • + William Kempf carefully considered the originally proposed interface and + suggested the new interface which is currently used. He also started and + fueled the discussion about the analogy optional<>/smart pointer + and about relational operators. +
  • - Peter Dimov, Joel de Guzman, David Abrahams, Tanton Gibbs and Ian Hanson - focused on the relational semantics of optional (originally undefined); concluding - with the fact that the pointer-like interface doesn't make it a pointer so - it shall have deep relational operators. -
  • + Peter Dimov, Joel de Guzman, David Abrahams, Tanton Gibbs and Ian Hanson + focused on the relational semantics of optional (originally undefined); + concluding with the fact that the pointer-like interface doesn't make it + a pointer so it shall have deep relational operators. +
  • - Augustus Saunders also explored the different relational semantics between - optional<> and a pointer and developed the OptionalPointee concept - as an aid against potential conflicts on generic code. -
  • + Augustus Saunders also explored the different relational semantics between + optional<> and a pointer and developed the OptionalPointee concept + as an aid against potential conflicts on generic code. +
  • - Joel de Guzman noticed that optional<> can be seen as an API on top - of variant<T,nil_t>. -
  • + Joel de Guzman noticed that optional<> can be seen as an API on top + of variant<T,nil_t>. +
  • - Dave Gomboc explained the meaning and usage of the Haskell analog to optional<>: - the Maybe type constructor (analogy originally pointed out by David Sankel). -
  • + Dave Gomboc explained the meaning and usage of the Haskell analog to optional<>: + the Maybe type constructor (analogy originally pointed out by David Sankel). +
  • - Other comments were posted by Vincent Finn, Anthony Williams, Ed Brey, Rob - Stewart, and others. -
  • + Other comments were posted by Vincent Finn, Anthony Williams, Ed Brey, + Rob Stewart, and others. +
  • - Joel de Guzman made the case for the support of references and helped with - the proper semantics. -
  • + Joel de Guzman made the case for the support of references and helped with + the proper semantics. +
  • - Mat Marcus shown the virtues of a value-oriented interface, influencing the - current design, and contributed the idea of "none". -
  • + Mat Marcus shown the virtues of a value-oriented interface, influencing + the current design, and contributed the idea of "none". +
-

-PrevUpHome +PrevUpHome
diff --git a/doc/html/boost_optional/dependencies_and_portability.html b/doc/html/boost_optional/dependencies_and_portability.html index 6f1f9cd..26c78f9 100644 --- a/doc/html/boost_optional/dependencies_and_portability.html +++ b/doc/html/boost_optional/dependencies_and_portability.html @@ -1,11 +1,11 @@ - + Dependencies and Portability - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Dependencies and Portability @@ -34,7 +34,7 @@

-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/detailed_semantics.html b/doc/html/boost_optional/detailed_semantics.html index 35c5a9c..e48adcb 100644 --- a/doc/html/boost_optional/detailed_semantics.html +++ b/doc/html/boost_optional/detailed_semantics.html @@ -1,11 +1,11 @@ - + Detailed Semantics - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -33,24 +33,24 @@

  • - If the entry reads: optional<T(not - a ref)>, the description - corresponds only to the case where T - is not of reference type. -
  • + If the entry reads: optional<T(not + a ref)>, the + description corresponds only to the case where T + is not of reference type. +
  • - If the entry reads: optional<T&>, - the description corresponds only to the case where T - is of reference type. -
  • + If the entry reads: optional<T&>, the description corresponds only + to the case where T is + of reference type. +
  • - If the entry reads: optional<T>, - the description is the same for both cases. -
  • + If the entry reads: optional<T>, the description is the same for both + cases. +
-
+
- +
[Note][Note] Note

@@ -64,277 +64,201 @@ space

- + optional class member functions

space

-

-

-
-

-

-

- optional<T>::optional(); -

-

-

-
+

+ optional<T>::optional(); +

  • -Effect: Default-Constructs an optional. -
  • + Effect: Default-Constructs an optional. +
  • -Postconditions:*this is uninitialized. -
  • + Postconditions: *this is uninitialized. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • - Notes: T's default constructor is not - called. -
  • + Notes: T's default constructor is not + called. +
  • -Example:
    optional<T> def ;
    +          Example: 
    +
    optional<T> def ;
     assert ( !def ) ;
     
    -
  • +

space

-

-

-
-

-

-

- optional<T>::optional( none_t ); -

-

-

-
+

+ optional<T>::optional( none_t ); +

  • -Effect: Constructs an optional - uninitialized. -
  • + Effect: Constructs an optional + uninitialized. +
  • -Postconditions:*this is uninitialized. -
  • + Postconditions: *this is uninitialized. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes:T's - default constructor is not called. - The expression boost::none denotes an instance of boost::none_t that can be used as the parameter. -
  • + Notes: T's + default constructor is not called. + The expression boost::none denotes an instance of boost::none_t that can be used as the parameter. +
  • -Example:
    #include <boost/none.hpp>
    +          Example: 
    +
    #include <boost/none.hpp>
     optional<T> n(none) ;
     assert ( !n ) ;
     
    -
  • +

space

-

-

-
-

-

-

- optional<T (not a ref)>::optional( T const& v ) -

-

-

-
+

+ optional<T (not a ref)>::optional( T const& v ) +

  • -Effect: Directly-Constructs an optional. -
  • + Effect: Directly-Constructs an optional. +
  • -Postconditions:*this is initialized - and its value is acopy of v. -
  • + Postconditions: *this is initialized + and its value is acopy of v. +
  • -Throws: Whatever T::T( - T const& ) throws. -
  • + Throws: Whatever T::T( + T const& ) + throws. +
  • -Notes: T::T( - T const& ) is - called. -
  • + Notes: T::T( + T const& ) + is called. +
  • -Exception Safety: Exceptions can only be - thrown during T::T( T - const& - ); in that case, this constructor - has no effect. -
  • + Exception Safety: Exceptions can only + be thrown during T::T( T + const& + ); in that case, this constructor + has no effect. +
  • -Example:
    T v;
    +          Example: 
    +
    T v;
     optional<T> opt(v);
     assert ( *opt == v ) ;
     
    -
  • +

space

-
-

-

-

- optional<T&>::optional( T& ref ) -

-

-

-
+

+ optional<T&>::optional( T& ref ) +

  • -Effect: Directly-Constructs an optional. -
  • + Effect: Directly-Constructs an optional. +
  • -Postconditions:*this is initialized - and its value is an instance of an internal type wrapping the reference - ref. -
  • + Postconditions: *this is initialized + and its value is an instance of an internal type wrapping the reference + ref. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Example:
    T v;
    +          Example: 
    +
    T v;
     T& vref = v ;
     optional<T&> opt(vref);
     assert ( *opt == v ) ;
     ++ v ; // mutate referee
     assert (*opt == v);
     
    -
  • +

space

-

-

-
-

-

-

- optional<T (not a ref)>::optional( bool condition, - T const& v ) ; -

-

-

-
-
-

-

-

- optional<T&> - ::optional( bool condition, - T& - v ) - ; -

-

-

-
+

+ optional<T (not a ref)>::optional( bool condition, T const& v ) ; +

+

+ optional<T&> ::optional( bool condition, T& + v ) ; +

  • - If condition is true, same as: -
-
-

-

-

- optional<T (not a ref)>::optional( T const& v ) -

-

-

-
-
-

-

-

- optional<T&> - ::optional( T& - v ) -

-

-

-
+ If condition is true, same as: + +

+ optional<T (not a ref)>::optional( T const& v ) +

+

+ optional<T&> ::optional( T& + v ) +

  • - otherwise, same as: -
-
-

-

-

- optional<T ['(not a - ref)]>::optional() -

-

-

-
-
-

-

-

- optional<T&> - ::optional() -

-

-

-
+ otherwise, same as: + +

+ optional<T ['(not a + ref)]>::optional() +

+

+ optional<T&> ::optional() +

space

-

-

-
-

-

-

- optional<T (not a ref)>::optional( optional - const& - rhs ); -

-

-

-
+

+ optional<T (not a ref)>::optional( optional const& rhs ); +

  • -Effect: Copy-Constructs an optional. -
  • + Effect: Copy-Constructs an optional. +
  • -Postconditions: If rhs is initialized, - *this - is initialized and its value is a copy of the value - of rhs; else *this is uninitialized. -
  • + Postconditions: If rhs is initialized, + *this + is initialized and its value is a copy of the value + of rhs; else *this is + uninitialized. +
  • -Throws: Whatever T::T( - T const& ) throws. -
  • + Throws: Whatever T::T( + T const& ) + throws. +
  • -Notes: If rhs is initialized, T::T(T const& ) is - called. -
  • + Notes: If rhs is initialized, T::T(T const& ) + is called. +
  • -Exception Safety: Exceptions can only be - thrown during T::T( T - const& - ); in that case, this constructor - has no effect. -
  • + Exception Safety: Exceptions can only + be thrown during T::T( T + const& + ); in that case, this constructor + has no effect. +
  • -Example:
    optional<T> uninit ;
    +          Example: 
    +
    optional<T> uninit ;
     assert (!uninit);
     
     optional<T> uinit2 ( uninit ) ;
    @@ -346,43 +270,38 @@
     optional<T> init2 ( init ) ;
     assert ( init2 == init ) ;
     
    -
  • +

space

-
-

-

-

- optional<T&>::optional( optional const& rhs ); -

-

-

-
+

+ optional<T&>::optional( optional const& rhs ); +

  • -Effect: Copy-Constructs an optional. -
  • + Effect: Copy-Constructs an optional. +
  • -Postconditions: If rhs - is initialized, *this - is initialized and its value is another reference to the same object referenced - by *rhs; - else *this - is uninitialized. -
  • + Postconditions: If rhs + is initialized, *this + is initialized and its value is another reference to the same object referenced + by *rhs; + else *this + is uninitialized. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes: If rhs - is initialized, both *this - and *rhs - will reefer to the same object (they alias). -
  • + Notes: If rhs + is initialized, both *this + and *rhs + will reefer to the same object (they alias). +
  • -Example:
    optional<T&> uninit ;
    +          Example: 
    +
    optional<T&> uninit ;
     assert (!uninit);
     
     optional<T&> uinit2 ( uninit ) ;
    @@ -400,115 +319,97 @@
     assert ( *init  == 3 ) ;
     assert ( *init2 == 3 ) ;
     
    -
  • +

space

-

-

-
-

-

-

- template<U> explicit optional<T - (not a ref)>::optional( optional<U> const& rhs ); -

-

-

-
+

+ template<U> explicit optional<T + (not a ref)>::optional( optional<U> const& rhs ); +

  • -Effect: Copy-Constructs an optional. -
  • + Effect: Copy-Constructs an optional. +
  • -Postconditions: If rhs - is initialized, *this - is initialized and its value is a copy of the value - of rhs converted to type T; - else *this - is uninitialized. -
  • + Postconditions: If rhs + is initialized, *this + is initialized and its value is a copy of the value + of rhs converted to type T; + else *this + is uninitialized. +
  • -Throws: Whatever T::T( - U const& ) throws. -
  • + Throws: Whatever T::T( + U const& ) + throws. +
  • -Notes: T::T( - U const& ) is - called if rhs is initialized, - which requires a valid conversion from U - to T. -
  • + Notes: T::T( + U const& ) + is called if rhs is initialized, + which requires a valid conversion from U + to T. +
  • -Exception Safety: Exceptions can only be - thrown during T::T( U - const& - ); in that case, this constructor - has no effect. -
  • + Exception Safety: Exceptions can only + be thrown during T::T( U + const& + ); in that case, this constructor + has no effect. +
  • -Example:
    optional<double> x(123.4);
    +          Example: 
    +
    optional<double> x(123.4);
     assert ( *x == 123.4 ) ;
     
     optional<int> y(x) ;
     assert( *y == 123 ) ;
     
    -
  • +

space

-

-

-
-

-

-

- template<InPlaceFactory> - explicit optional<T - (not a ref)>::optional( InPlaceFactory const& f ); -

-

-

-
-
-

-

-

- template<TypedInPlaceFactory> - explicit optional<T - (not a ref)>::optional( TypedInPlaceFactory const& f ); -

-

-

-
+

+ template<InPlaceFactory> + explicit optional<T + (not a ref)>::optional( InPlaceFactory const& f ); +

+

+ template<TypedInPlaceFactory> + explicit optional<T + (not a ref)>::optional( TypedInPlaceFactory const& f ); +

  • -Effect: Constructs an optional - with a value of T obtained - from the factory. -
  • + Effect: Constructs an optional + with a value of T obtained + from the factory. +
  • -Postconditions: *this is initialized - and its value is directly given from the factory f (i.e., the value is - not copied). -
  • + Postconditions: *this is initialized + and its value is directly given from the factory + f (i.e., the value is not copied). +
  • -Throws: Whatever the T - constructor called by the factory throws. -
  • + Throws: Whatever the T + constructor called by the factory throws. +
  • -Notes: See In-Place - Factories -
  • + Notes: See In-Place + Factories +
  • -Exception Safety: Exceptions can only be - thrown during the call to the T - constructor used by the factory; in that case, this constructor has no effect. -
  • + Exception Safety: Exceptions can only + be thrown during the call to the T + constructor used by the factory; in that case, this constructor has no + effect. +
  • -Example:
    class C { C ( char, double, std::string ) ; } ;
    +          Example: 
    +
    class C { C ( char, double, std::string ) ; } ;
     
     C v('A',123.4,"hello");
     
    @@ -518,55 +419,45 @@
     assert ( *x == v ) ;
     assert ( *y == v ) ;
     
    -
  • +

space

-

-

-
-

-

-

- optional& - optional<T (not a ref)>::operator= ( T - const& - rhs ) - ; -

-

-

-
+

+ optional& + optional<T (not a ref)>::operator= ( T + const& + rhs ) + ; +

  • -Effect: Assigns the value rhs to an optional. -
  • + Effect: Assigns the value rhs to an optional. +
  • -Postconditions: *this is initialized and its value is a copy - of rhs. -
  • + Postconditions: *this is initialized and its value is a + copy of rhs. +
  • -Throws: Whatever T::operator=( T const& ) or - T::T(T - const&) - throws. -
  • + Throws: Whatever T::operator=( T const& ) or T::T(T const&) throws. +
  • -Notes: If *this was initialized, T's - assignment operator is used, otherwise, its copy-constructor is used. -
  • + Notes: If *this was initialized, T's + assignment operator is used, otherwise, its copy-constructor is used. +
  • -Exception Safety: In the event of an exception, - the initialization state of *this is unchanged and its value unspecified - as far as optional is concerned - (it is up to T's operator=()). - If *this - is initially uninitialized and T's - copy constructor fails, *this is left properly uninitialized. -
  • + Exception Safety: In the event of an exception, + the initialization state of *this is unchanged and its value unspecified + as far as optional is concerned + (it is up to T's operator=()). + If *this + is initially uninitialized and T's + copy constructor fails, *this is left properly uninitialized. +
  • -Example:
    T x;
    +          Example: 
    +
    T x;
     optional<T> def ;
     optional<T> opt(x) ;
     
    @@ -576,39 +467,34 @@
     opt = y ;
     assert ( *opt == y ) ;
     
    -
  • +

space

-
-

-

-

- optional<T&>& - optional<T&>::operator= ( T& - const& - rhs ) - ; -

-

-

-
+

+ optional<T&>& + optional<T&>::operator= ( T& + const& + rhs ) + ; +

  • -Effect: (Re)binds thee wrapped reference. -
  • + Effect: (Re)binds thee wrapped reference. +
  • -Postconditions: *this is initialized and it references the - same object referenced by rhs. -
  • + Postconditions: *this is initialized and it references the + same object referenced by rhs. +
  • -Notes: If *this was initialized, is is rebound - to the new object. See here - for details on this behavior. -
  • + Notes: If *this was initialized, is is rebound + to the new object. See here + for details on this behavior. +
  • -Example:
    int a = 1 ;
    +          Example: 
    +
    int a = 1 ;
     int b = 2 ;
     T& ra = a ;
     T& rb = b ;
    @@ -625,59 +511,54 @@
     c = 4 ;
     assert ( *opt == 4 ) ;
     
    -
  • +

space

-

-

-
-

-

-

- optional& - optional<T (not a ref)>::operator= ( optional - const& - rhs ) - ; -

-

-

-
+

+ optional& + optional<T (not a ref)>::operator= ( optional + const& + rhs ) + ; +

  • -Effect: Assigns another optional - to an optional. -
  • + Effect: Assigns another optional to an optional. +
  • -Postconditions: If rhs - is initialized, *this - is initialized and its value is a copy of the value - of rhs; else *this is uninitialized. -
  • + Postconditions: If rhs + is initialized, *this + is initialized and its value is a copy of the value + of rhs; else *this is + uninitialized. +
  • -Throws: Whatever T::operator( T const&) or T::T( - T const& ) throws. -
  • + Throws: Whatever T::operator( T const&) + or T::T( T + const& + ) throws. +
  • -Notes: If both *this and rhs - are initially initialized, T's - assignment operator is used. If *this is initially initialized but rhs is uninitialized, T's - [destructor] is called. If *this is initially uninitialized but rhs is initialized, T's - copy constructor is called. -
  • + Notes: If both *this and rhs + are initially initialized, T's + assignment operator is used. If *this is initially initialized but rhs is uninitialized, T's + [destructor] is called. If *this is initially uninitialized but rhs is initialized, T's + copy constructor is called. +
  • -Exception Safety: In the event of an exception, - the initialization state of *this is unchanged and its value unspecified - as far as optional is concerned (it is up to T's - operator=()). - If *this - is initially uninitialized and T's - copy constructor fails, *this is left properly uninitialized. -
  • + Exception Safety: In the event of an exception, + the initialization state of *this is unchanged and its value unspecified + as far as optional is concerned (it is up to T's + operator=()). + If *this + is initially uninitialized and T's + copy constructor fails, *this is left properly uninitialized. +
  • -Example:
    T v;
    +          Example: 
    +
    T v;
     optional<T> opt(v);
     optional<T> def ;
     
    @@ -685,36 +566,34 @@
     assert ( !def ) ;
     // previous value (copy of 'v') destroyed from within 'opt'.
     
    -
  • +

space

-
-

-

-

- optional<T&> - & optional<T&>::operator= ( optional<T&> const& rhs ) ; -

-

-

-
+

+ optional<T&> & optional<T&>::operator= ( optional<T&> + const& + rhs ) + ; +

  • -Effect: (Re)binds thee wrapped reference. -
  • + Effect: (Re)binds thee wrapped reference. +
  • -Postconditions: If *rhs is initialized, *this is initialized and it references the - same object referenced by *rhs; otherwise, *this is uninitialized (and references no object). -
  • + Postconditions: If *rhs is initialized, *this is initialized and it references the + same object referenced by *rhs; otherwise, *this is uninitialized (and references no + object). +
  • -Notes: If *this was initialized and so is *rhs, this - is is rebound to the new object. See here - for details on this behavior. -
  • + Notes: If *this was initialized and so is *rhs, this + is is rebound to the new object. See here + for details on this behavior. +
  • -Example:
    int a = 1 ;
    +          Example: 
    +
    int a = 1 ;
     int b = 2 ;
     T& ra = a ;
     T& rb = b ;
    @@ -733,191 +612,179 @@
     c = 4 ;
     assert ( *ora == 4 ) ;
     
    -
  • +

space

-

-

-
-

-

-

- template<U> optional& - optional<T (not a ref)>::operator= ( optional<U> const& rhs ) ; -

-

-

-
+

+ template<U> optional& + optional<T (not a ref)>::operator= ( optional<U> + const& + rhs ) + ; +

  • -Effect: Assigns another convertible optional - to an optional. -
  • + Effect: Assigns another convertible optional + to an optional. +
  • -Postconditions: If rhs - is initialized, *this - is initialized and its value is a copy of the value - of rhsconverted - to type T; else *this is uninitialized. -
  • + Postconditions: If rhs + is initialized, *this + is initialized and its value is a copy of the value + of rhs converted + to type T; else *this is + uninitialized. +
  • -Throws: Whatever T::operator=( U const& ) or - T::T( U - const& - ) throws. -
  • + Throws: Whatever T::operator=( U const& ) or T::T( + U const& ) + throws. +
  • -Notes: If both *this and rhs are initially initialized, T's assignment operator - (from U) is used. If *this is initially - initialized but rhs is uninitialized, - T's destructor - is called. If *this - is initially uninitialized but rhs is initialized, T's - converting constructor (from U) - is called. -
  • + Notes: If both *this and rhs are initially initialized, + T's assignment + operator (from U) + is used. If *this + is initially initialized but rhs + is uninitialized, T's + destructor is called. If *this is initially uninitialized but rhs + is initialized, T's converting + constructor (from U) + is called. +
  • -Exception Safety: In the event of an exception, - the initialization state of *this is unchanged and its value unspecified - as far as optional is concerned (it is up to T's - operator=()). - If *this - is initially uninitialized and T's - converting constructor fails, *this is left properly uninitialized. -
  • + Exception Safety: In the event of an exception, + the initialization state of *this is unchanged and its value unspecified + as far as optional is concerned (it is up to T's + operator=()). + If *this + is initially uninitialized and T's + converting constructor fails, *this is left properly uninitialized. +
  • -Example:
    T v;
    +          Example: 
    +
    T v;
     optional<T> opt0(v);
     optional<U> opt1;
     
     opt1 = opt0 ;
     assert ( *opt1 == static_cast<U>(v) ) ;
     
    -
  • +

space

-

-

-
-

-

-

- void optional<T - (not a ref)>::reset( T const& v ) ; -

-

-

-
-
  • -Deprecated: same as operator= ( T +

    + template<InPlaceFactory> + optional<T>& optional<T (not a ref)>::operator=( InPlaceFactory const& - v) ; -

-

- space -

-

-

-
-

-

-

- void optional<T>::reset() ; -

-

-

-
-
  • -Deprecated: Same as operator=( detail::none_t ); -
-

- space -

-

-

-
-

-

-

- T const& optional<T - (not a ref)>::operator*() const ; -

-

-

-
-
-

-

-

- T& - optional<T (not a ref)>::operator*(); -

-

-

-
-
-

-

-

- T const& optional<T - (not a ref)>::get() const ; -

-

-

-
-
-

-

-

- T& - optional<T (not a ref)>::get() ; -

-

-

-
-
-

-

-

- inline T - const& - get ( - optional<T (not a ref)> const& ) ; -

-

-

-
-
-

-

-

- inline T& get ( optional<T - (not a ref)> - &) ; -

-

-

-
+ f );
+

+

+ template<TypedInPlaceFactory> + optional<T>& optional<T (not a ref)>::operator=( TypedInPlaceFactory + const& + f ); +

  • -Requirements:*this is initialized -
  • + Effect: Assigns an optional + with a value of T obtained + from the factory. +
  • -Returns: A reference to the contained value -
  • + Postconditions: *this is initialized + and its value is directly given from the factory + f (i.e., the value is not copied). +
  • -Throws: Nothing. -
  • + Throws: Whatever the T + constructor called by the factory throws. +
  • -Notes: The requirement is asserted via - BOOST_ASSERT(). -
  • + Notes: See In-Place + Factories +
  • -Example:
    T v ;
    +          Exception Safety: Exceptions can only
    +          be thrown during the call to the T
    +          constructor used by the factory; in that case, the optional
    +          object will be left empty.
    +        
  • +
+

+ space +

+

+ void optional<T + (not a ref)>::reset( T const& v ) ; +

+
  • + Deprecated: same as operator= ( T + const& + v) + ; +
+

+ space +

+

+ void optional<T>::reset() ; +

+
  • + Deprecated: Same as operator=( detail::none_t ); +
+

+ space +

+

+ T const& optional<T + (not a ref)>::operator*() const ; +

+

+ T& + optional<T (not a ref)>::operator*(); +

+

+ T const& optional<T + (not a ref)>::get() const ; +

+

+ T& + optional<T (not a ref)>::get() ; +

+

+ inline T + const& + get ( + optional<T (not a ref)> const& ) ; +

+

+ inline T& get ( optional<T + (not a ref)> + &) ; +

+
    +
  • + Requirements: *this is initialized +
  • +
  • + Returns: A reference to the contained + value +
  • +
  • + Throws: Nothing. +
  • +
  • + Notes: The requirement is asserted via + BOOST_ASSERT(). +
  • +
  • + Example: +
    T v ;
     optional<T> opt ( v );
     T const& u = *opt;
     assert ( u == v ) ;
    @@ -925,73 +792,45 @@
     *opt = w ;
     assert ( *opt == w ) ;
     
    -
  • +

space

-

-

-
-

-

-

- T const& optional<T - (not a ref)>::get_value_or( - T const& default) const ; -

-

-

-
-
-

-

-

- T& - optional<T (not a ref)>::get_value_or( T& - default ) - ; -

-

-

-
-
-

-

-

- inline T - const& - get_optional_value_or ( - optional<T (not a ref)> const& o, T const& default ) ; -

-

-

-
-
-

-

-

- inline T& get_optional_value_or - ( optional<T - (not a ref)>& - o, - T& - default ) - ; -

-

-

-
+

+ T const& optional<T + (not a ref)>::get_value_or( + T const& default) const ; +

+

+ T& + optional<T (not a ref)>::get_value_or( T& + default ) + ; +

+

+ inline T + const& + get_optional_value_or ( + optional<T (not a ref)> const& o, T const& default ) ; +

+

+ inline T& get_optional_value_or + ( optional<T + (not a ref)>& + o, T& default ) ; +

  • -Returns: A reference to the contained value, - if any, or default. -
  • + Returns: A reference to the contained + value, if any, or default. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Example:
    T v, z ;
    +          Example: 
    +
    T v, z ;
     optional<T> def;
     T const& y = def.get_value_or(z);
     assert ( y == z ) ;
    @@ -1001,90 +840,53 @@
     assert ( u == v ) ;
     assert ( u != z ) ;
     
    -
  • +

space

-
-

-

-

- T const& optional<T&>::operator*() const ; -

-

-

-
-
-

-

-

- T & - optional<T&>::operator*(); -

-

-

-
-
-

-

-

- T const& optional<T&>::get() const ; -

-

-

-
-
-

-

-

- T& - optional<T&>::get() ; -

-

-

-
-
-

-

-

- inline T - const& - get ( - optional<T&> - const& - ) ; -

-

-

-
-
-

-

-

- inline T& get ( optional<T&> &) - ; -

-

-

-
+

+ T const& optional<T&>::operator*() const ; +

+

+ T & + optional<T&>::operator*(); +

+

+ T const& optional<T&>::get() const ; +

+

+ T& + optional<T&>::get() ; +

+

+ inline T + const& + get ( + optional<T&> const& ) ; +

+

+ inline T& get ( optional<T&> + &) ; +

  • -Requirements: *this is initialized -
  • + Requirements: *this is initialized +
  • -Returns:The - reference contained. -
  • + Returns: The + reference contained. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes: The requirement is asserted via - BOOST_ASSERT(). -
  • + Notes: The requirement is asserted via + BOOST_ASSERT(). +
  • -Example:
    T v ;
    +          Example: 
    +
    T v ;
     T& vref = v ;
     optional<T&> opt ( vref );
     T const& vref2 = *opt;
    @@ -1092,72 +894,46 @@
     ++ v ;
     assert ( *opt == v ) ;
     
    -
  • +

space

-

-

-
-

-

-

- T const* optional<T - (not a ref)>::get_ptr() const ; -

-

-

-
-
-

-

-

- T* - optional<T (not a ref)>::get_ptr() ; -

-

-

-
-
-

-

-

- inline T - const* - get_pointer ( - optional<T (not a ref)> const& ) ; -

-

-

-
-
-

-

-

- inline T* get_pointer - ( optional<T - (not a ref)> - &) ; -

-

-

-
+

+ T const* optional<T + (not a ref)>::get_ptr() const ; +

+

+ T* + optional<T (not a ref)>::get_ptr() ; +

+

+ inline T + const* get_pointer ( + optional<T (not a ref)> const& ) ; +

+

+ inline T* get_pointer + ( optional<T + (not a ref)> + &) ; +

  • -Returns: If *this is initialized, a pointer to the contained - value; else 0 (null). -
  • + Returns: If *this is initialized, a pointer to the contained + value; else 0 (null). +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes: The contained value is permanently - stored within *this, - so you should not hold nor delete this pointer -
  • + Notes: The contained value is permanently + stored within *this, + so you should not hold nor delete this pointer +
  • -Example:
    T v;
    +          Example: 
    +
    T v;
     optional<T> opt(v);
     optional<T> const copt(v);
     T* p = opt.get_ptr() ;
    @@ -1165,213 +941,163 @@
     assert ( p == get_pointer(opt) );
     assert ( cp == get_pointer(copt) ) ;
     
    -
  • +

space

-

-

-
-

-

-

- T const* optional<T - (not a ref)>::operator ->() - const ; -

-

-

-
-
-

-

-

- T* - optional<T (not a ref)>::operator - ->() ; -

-

-

-
+

+ T const* optional<T + (not a ref)>::operator ->() + const ; +

+

+ T* + optional<T (not a ref)>::operator ->() ; +

  • -Requirements: *this is initialized. -
  • + Requirements: *this is initialized. +
  • -Returns: A pointer to the contained value. -
  • + Returns: A pointer to the contained value. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes: The requirement is asserted via - BOOST_ASSERT(). -
  • + Notes: The requirement is asserted via + BOOST_ASSERT(). +
  • -Example:
    struct X { int mdata ; } ;
    +          Example: 
    +
    struct X { int mdata ; } ;
     X x ;
     optional<X> opt (x);
     opt->mdata = 2 ;
     
    -
  • +

space

-

-

-
-

-

-

- optional<T>::operator unspecified-bool-type() const ; -

-

-

-
+

+ optional<T>::operator unspecified-bool-type() const ; +

  • -Returns: An unspecified value which if used - on a boolean context is equivalent to (get() != 0) -
  • + Returns: An unspecified value which if + used on a boolean context is equivalent to (get() != 0) +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Example:
    optional<T> def ;
    +          Example: 
    +
    optional<T> def ;
     assert ( def == 0 );
     optional<T> opt ( v ) ;
     assert ( opt );
     assert ( opt != 0 );
     
    -
  • +

space

-

-

-
-

-

-

- bool optional<T>::operator!() ; -

-

-

-
+

+ bool optional<T>::operator!() ; +

  • -Returns: If *this is uninitialized, true; - else false. -
  • + Returns: If *this is uninitialized, true; + else false. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes: This operator is provided for those - compilers which can't use the unspecified-bool-type operator - in certain boolean contexts. -
  • + Notes: This operator is provided for those + compilers which can't use the unspecified-bool-type operator + in certain boolean contexts. +
  • -Example:
    optional<T> opt ;
    +          Example: 
    +
    optional<T> opt ;
     assert ( !opt );
     *opt = some_T ;
     
     // Notice the "double-bang" idiom here.
     assert ( !!opt ) ;
     
    -
  • +

space

-

-

-
-

-

-

- bool optional<T>::is_initialized() const ; -

-

-

-
+

+ bool optional<T>::is_initialized() + const ; +

  • -Returns: true - if the optional is initialized, - false otherwise. -
  • + Returns: true + if the optional is initialized, + false otherwise. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Example:
    optional<T> def ;
    +          Example: 
    +
    optional<T> def ;
     assert ( !def.is_initialized() );
     optional<T> opt ( v ) ;
     assert ( opt.is_initialized() );
     
    -
  • +

space

- + Free functions

space

-

-

-
-

-

-

- optional<T (not a ref)> make_optional( T const& v ) -

-

-

-
+

+ optional<T (not a ref)> make_optional( T const& v ) +

  • -Returns: optional<T>(v) for - the deduced type T - of v. -
  • + Returns: optional<T>(v) for the deduced type + T of v. +
  • -Example:
    template<class T> void foo ( optional<T> const& opt ) ;
    +          Example: 
    +
    template<class T> void foo ( optional<T> const& opt ) ;
     
     foo ( make_optional(1+1) ) ; // Creates an optional<int>
     
    -
  • +

space

-

-

-
-

-

-

- optional<T (not a ref)> make_optional( bool condition, - T const& v ) -

-

-

-
+

+ optional<T (not a ref)> make_optional( bool condition, T const& v ) +

  • -Returns: optional<T>(condition,v) for - the deduced type T - of v. -
  • + Returns: optional<T>(condition,v) + for the deduced type T + of v. +
  • -Example:
    optional<double> calculate_foo()
    +          Example: 
    +
    optional<double> calculate_foo()
     {
       double val = compute_foo();
       return make_optional(is_not_nan_and_finite(val),val);
    @@ -1381,44 +1107,40 @@
     if ( !v )
       error("foo wasn't computed");
     
    -
  • +

space

-

-

-
-

-

-

- bool operator - == ( optional<T> const& x, optional<T> const& y ); -

-

-

-
+

+ bool operator + == ( optional<T> const& x, optional<T> + const& + y ); +

  • -Returns: If both x - and y are initialized, (*x == - *y). If only x - or y is initialized, false. If both are uninitialized, true. -
  • + Returns: If both x + and y are initialized, + (*x + == *y). If + only x or y is initialized, false. + If both are uninitialized, true. +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes: Pointers have shallow relational - operators while optional - has deep relational operators. Do not use operator - == directly in generic code which - expect to be given either an optional<T> - or a pointer; use equal_pointees() - instead -
  • + Notes: Pointers have shallow relational + operators while optional + has deep relational operators. Do not use operator + == directly in generic code which + expect to be given either an optional<T> or a pointer; use equal_pointees() + instead +
  • -Example:
    T x(12);
    +          Example: 
    +
    T x(12);
     T y(12);
     T z(21);
     optional<T> def0 ;
    @@ -1441,45 +1163,41 @@
     assert ( optX == optY ) ;
     assert ( optX != optZ ) ;
     
    -
  • +

space

-

-

-
-

-

-

- bool operator - < ( - optional<T> const& x, optional<T> const& y ); -

-

-

-
+

+ bool operator + < ( optional<T> const& x, optional<T> + const& + y ); +

  • -Returns: If y - is not initialized, false. If - y is initialized and x is not initialized, true. - If both x and y are initialized, (*x < *y). -
  • + Returns: If y + is not initialized, false. + If y is initialized and + x is not initialized, + true. If both x and y + are initialized, (*x + < *y). +
  • -Throws: Nothing. -
  • + Throws: Nothing. +
  • -Notes: Pointers have shallow relational - operators while optional - has deep relational operators. Do not use operator - < directly in generic code which - expect to be given either an optional<T> - or a pointer; use less_pointees() - instead. -
  • + Notes: Pointers have shallow relational + operators while optional + has deep relational operators. Do not use operator + < directly in generic code which + expect to be given either an optional<T> or a pointer; use less_pointees() + instead. +
  • -Example:
    T x(12);
    +          Example: 
    +
    T x(12);
     T y(34);
     optional<T> def ;
     optional<T> optX(x);
    @@ -1499,157 +1217,124 @@
     assert ( optX == optY ) ;
     assert ( optX != optZ ) ;
     
    -
  • +

space

-

-

-
-

-

-

- bool operator - != ( optional<T> const& x, optional<T> const& y ); -

-

-

-
-
    -
  • -Returns: !( - x == - y ); -
  • -
  • -Throws: Nothing. -
  • -
-

- space -

-

-

-
-

-

-

- bool operator - > ( - optional<T> const& x, optional<T> const& y ); -

-

-

-
-
    -
  • -Returns: ( - y < - x ); -
  • -
  • -Throws: Nothing. -
  • -
-

- space -

-

-

-
-

-

-

- bool operator - <= ( - optional<T> const& x, optional<T> const& y ); -

-

-

-
-
    -
  • -Returns: !( - y<x ); -
  • -
  • -Throws: Nothing. -
  • -
-

- space -

-

-

-
-

-

-

- bool operator - >= ( - optional<T> const& x, optional<T> const& y ); -

-

-

-
-
    -
  • -Returns: !( - x<y ); -
  • -
  • -Throws: Nothing. -
  • -
-

- space -

-

-

-
-

-

-

- void swap - ( optional<T>& x, optional<T>& y - ); -

-

-

-
-
    -
  • -Effect: If both x - and y are initialized, calls - swap(*x,*y) using std::swap. - If only one is initialized, say x, - calls: y.reset(*x); x.reset(); If none is initialized, does nothing. -
  • -
  • -Postconditions: The states of x and y - interchanged. -
  • -
  • -Throws: If both are initialized, whatever - swap(T&,T&) - throws. If only one is initialized, whatever T::T ( - T const& ) throws. -
  • -
  • -Notes: If both are initialized, swap(T&,T&) is used unqualified but with std::swap - introduced in scope. If only one is initialized, T::~T() - and T::T( T +

    + bool operator + != ( optional<T> const& x, optional<T> const& - ) is called. -

  • + y ); +

+
  • -Exception Safety: If both are initialized, - this operation has the exception safety guarantees of swap(T&,T&). - If only one is initialized, it has the same basic guarantee as optional<T>::reset( T const& ). -
  • + Returns: !( + x == + y ); +
  • -Example:
    T x(12);
    +          Throws: Nothing.
    +        
  • +
+

+ space +

+

+ bool operator + > ( optional<T> const& x, optional<T> + const& + y ); +

+
    +
  • + Returns: ( + y < + x ); +
  • +
  • + Throws: Nothing. +
  • +
+

+ space +

+

+ bool operator + <= ( + optional<T> const& x, optional<T> + const& + y ); +

+
    +
  • + Returns: !( + y<x ); +
  • +
  • + Throws: Nothing. +
  • +
+

+ space +

+

+ bool operator + >= ( + optional<T> const& x, optional<T> + const& + y ); +

+
    +
  • + Returns: !( + x<y ); +
  • +
  • + Throws: Nothing. +
  • +
+

+ space +

+

+ void swap + ( optional<T>& + x, optional<T>& y ); +

+
    +
  • + Effect: If both x + and y are initialized, + calls swap(*x,*y) using std::swap. + If only one is initialized, say x, + calls: y.reset(*x); x.reset(); If none is initialized, does nothing. +
  • +
  • + Postconditions: The states of x and y + interchanged. +
  • +
  • + Throws: If both are initialized, whatever + swap(T&,T&) + throws. If only one is initialized, whatever T::T ( T const& ) throws. +
  • +
  • + Notes: If both are initialized, swap(T&,T&) + is used unqualified but with std::swap + introduced in scope. If only one is initialized, T::~T() and T::T( + T const& ) + is called. +
  • +
  • + Exception Safety: If both are initialized, + this operation has the exception safety guarantees of swap(T&,T&). + If only one is initialized, it has the same basic guarantee as optional<T>::reset( T const& ). +
  • +
  • + Example: +
    T x(12);
     T y(21);
     optional<T> def0 ;
     optional<T> def1 ;
    @@ -1668,12 +1353,12 @@
     assert ( *optX == y );
     assert ( *optY == x );
     
    -
  • +
-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/development.html b/doc/html/boost_optional/development.html index 7c96256..159fd33 100644 --- a/doc/html/boost_optional/development.html +++ b/doc/html/boost_optional/development.html @@ -1,28 +1,28 @@ - + Development - - - + + + - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+ -
+
@@ -112,63 +112,63 @@

  • -deep-copy semantics: copies of the variant - implies copies of the value. -
  • + deep-copy semantics: copies of the variant + implies copies of the value. +
  • -deep-relational semantics: comparisons - between variants matches both current types and values -
  • + deep-relational semantics: comparisons + between variants matches both current types and values +
  • - If the variant's current type is T, - it is modeling an initialized optional. -
  • + If the variant's current type is T, + it is modeling an initialized optional. +
  • - If the variant's current type is not T, - it is modeling an uninitialized optional. -
  • + If the variant's current type is not T, + it is modeling an uninitialized optional. +
  • - Testing if the variant's current type is T - models testing if the optional is initialized -
  • + Testing if the variant's current type is T + models testing if the optional is initialized +
  • - Trying to extract a T from - a variant when its current type is not T, - models the undefined behavior of trying to access the value of an uninitialized - optional -
  • + Trying to extract a T + from a variant when its current type is not T, + models the undefined behavior of trying to access the value of an uninitialized + optional +

Single-element container:

  • -deep-copy semantics: copies of the container - implies copies of the value. -
  • + deep-copy semantics: copies of the container + implies copies of the value. +
  • -deep-relational semantics: comparisons - between containers compare container size and if match, contained value -
  • + deep-relational semantics: comparisons + between containers compare container size and if match, contained value +
  • - If the container is not empty (contains an object of type T), it is modeling an initialized - optional. -
  • + If the container is not empty (contains an object of type T), it is modeling an initialized + optional. +
  • - If the container is empty, it is modeling an uninitialized - optional. -
  • + If the container is empty, it is modeling an uninitialized + optional. +
  • - Testing if the container is empty models testing if the optional is initialized -
  • + Testing if the container is empty models testing if the optional is initialized +
  • - Trying to extract a T from - an empty container models the undefined behavior of trying to access the - value of an uninitialized optional -
  • + Trying to extract a T + from an empty container models the undefined behavior of trying to access + the value of an uninitialized optional +
-
+
@@ -195,56 +195,57 @@

  • -Default Construction: To introduce a formally - uninitialized wrapped object. -
  • + Default Construction: To introduce a + formally uninitialized wrapped object. +
  • -Direct Value Construction via copy: To - introduce a formally initialized wrapped object whose value is obtained - as a copy of some object. -
  • + Direct Value Construction via copy: + To introduce a formally initialized wrapped object whose value is obtained + as a copy of some object. +
  • -Deep Copy Construction: To obtain a new - yet equivalent wrapped object. -
  • + Deep Copy Construction: To obtain a + new yet equivalent wrapped object. +
  • -Direct Value Assignment (upon initialized): - To assign a value to the wrapped object. -
  • + Direct Value Assignment (upon initialized): + To assign a value to the wrapped object. +
  • -Direct Value Assignment (upon uninitialized): - To initialize the wrapped object with a value obtained as a copy of some - object. -
  • + Direct Value Assignment (upon uninitialized): + To initialize the wrapped object with a value obtained as a copy of some + object. +
  • -Assignment (upon initialized): To assign - to the wrapped object the value of another wrapped object. -
  • + Assignment (upon initialized): To assign + to the wrapped object the value of another wrapped object. +
  • -Assignment (upon uninitialized): To initialize - the wrapped object with value of another wrapped object. -
  • + Assignment (upon uninitialized): To + initialize the wrapped object with value of another wrapped object. +
  • -Deep Relational Operations (when supported by the - type T): To compare wrapped object values taking into account - the presence of uninitialized states. -
  • + Deep Relational Operations (when supported by the + type T): To compare wrapped object values taking into account + the presence of uninitialized states. +
  • -Value access: To unwrap the wrapped object. -
  • + Value access: To unwrap the wrapped + object. +
  • -Initialization state query: To determine - if the object is formally initialized or not. -
  • + Initialization state query: To determine + if the object is formally initialized or not. +
  • -Swap: To exchange wrapped objects. (with - whatever exception safety guarantees are provided by T's - swap). -
  • + Swap: To exchange wrapped objects. (with + whatever exception safety guarantees are provided by T's + swap). +
  • -De-initialization: To release the wrapped - object (if any) and leave the wrapper in the uninitialized state. -
  • + De-initialization: To release the wrapped + object (if any) and leave the wrapper in the uninitialized state. +

Additional operations are useful, such as converting constructors and converting @@ -252,7 +253,7 @@ via a pointer to the wrapped object or null.

-
+
@@ -292,7 +293,7 @@ itself which are supported by a special interface.

- + Lexically-hinted Value Access in the presence of possibly untitialized optional objects: The operators * and -> @@ -357,7 +358,7 @@ incarnated by pointers.

- + Optional<T> as a model of OptionalPointee
@@ -367,9 +368,9 @@ about the possibly uninitialized state appealing to the familiar pointer semantics w.r.t. to null pointers.

-
+
- +
[Warning][Warning] Warning

@@ -398,7 +399,7 @@ -


-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/examples.html b/doc/html/boost_optional/examples.html index 95c4ab1..7773534 100644 --- a/doc/html/boost_optional/examples.html +++ b/doc/html/boost_optional/examples.html @@ -1,11 +1,11 @@ - + Examples - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+ -
+

Optional return values @@ -57,7 +57,7 @@ }

-
+

Optional local variables @@ -78,7 +78,7 @@ else print("employer's name not found!");

-
+

Optional data members @@ -116,7 +116,7 @@ };

-
+
-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/exception_safety_guarantees.html b/doc/html/boost_optional/exception_safety_guarantees.html index cf3577e..98b37fa 100644 --- a/doc/html/boost_optional/exception_safety_guarantees.html +++ b/doc/html/boost_optional/exception_safety_guarantees.html @@ -1,11 +1,11 @@ - + Exception Safety Guarantees - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Exception Safety Guarantees @@ -32,20 +32,28 @@ Notes), all of the assignment methods:

    -
  • optional<T>::operator= ( optional<T> - const& - )
  • -
  • optional<T>::operator= ( T const& )
  • -
  • template<class U> optional<T>::operator= ( optional<U> - const& - )
  • -
  • template<class InPlaceFactory> optional<T>::operator= ( InPlaceFactory - const& - )
  • -
  • template<class TypedInPlaceFactory> optional<T>::operator= ( TypedInPlaceFactory - const& - )
  • -
  • optional<T>:::reset ( T const&)
  • +
  • + optional<T>::operator= ( optional<T> const& ) +
  • +
  • + optional<T>::operator= ( T const& ) +
  • +
  • + template<class U> optional<T>::operator= ( optional<U> const& ) +
  • +
  • + template<class InPlaceFactory> optional<T>::operator= ( InPlaceFactory + const& + ) +
  • +
  • + template<class TypedInPlaceFactory> optional<T>::operator= ( TypedInPlaceFactory + const& + ) +
  • +
  • + optional<T>:::reset ( T const&) +

Can only guarantee the basic @@ -57,8 +65,12 @@ On the other hand, the uninitializing methods:

    -
  • optional<T>::operator= ( detail::none_t )
  • -
  • optional<T>::reset()
  • +
  • + optional<T>::operator= ( detail::none_t ) +
  • +
  • + optional<T>::reset() +

Provide the no-throw guarantee (assuming a no-throw T::~T()) @@ -112,7 +124,7 @@ }

- + Swap

@@ -126,7 +138,7 @@

-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/implementation_notes.html b/doc/html/boost_optional/implementation_notes.html index bdaa201..08374b1 100644 --- a/doc/html/boost_optional/implementation_notes.html +++ b/doc/html/boost_optional/implementation_notes.html @@ -1,11 +1,11 @@ - + Implementation Notes - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -41,7 +41,7 @@
-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/in_place_factories.html b/doc/html/boost_optional/in_place_factories.html index e23a41b..87ee45c 100644 --- a/doc/html/boost_optional/in_place_factories.html +++ b/doc/html/boost_optional/in_place_factories.html @@ -1,11 +1,11 @@ - + In-Place Factories - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -129,14 +129,14 @@

  • -TypedInPlaceFactories: those which - take the target type as a primary template parameter. -
  • + TypedInPlaceFactories: those which + take the target type as a primary template parameter. +
  • -InPlaceFactories: those with a template - construct(void*) member - function taking the target type. -
  • + InPlaceFactories: those with a template + construct(void*) member + function taking the target type. +

Within each group, all the family members differ only in the number of parameters @@ -182,7 +182,7 @@

-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/optional_references.html b/doc/html/boost_optional/optional_references.html index 9222d48..d50412b 100644 --- a/doc/html/boost_optional/optional_references.html +++ b/doc/html/boost_optional/optional_references.html @@ -1,11 +1,11 @@ - + Optional references - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -37,20 +37,20 @@

  • - Converting constructors -
  • + Converting constructors +
  • - Converting assignment -
  • + Converting assignment +
  • - InPlace construction -
  • + InPlace construction +
  • - InPlace assignment -
  • + InPlace assignment +
  • - Value-access via pointer -
  • + Value-access via pointer +

Also, even though optional<T&> @@ -59,19 +59,19 @@

  • - Copies of optional<T&> - will copy the references but all these references will nonetheless reefer - to the same object. -
  • + Copies of optional<T&> + will copy the references but all these references will nonetheless reefer + to the same object. +
  • - Value-access will actually provide access to the referenced object rather - than the reference itself. -
  • + Value-access will actually provide access to the referenced object rather + than the reference itself. +
-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/rebinding_semantics_for_assignment_of_optional_references.html b/doc/html/boost_optional/rebinding_semantics_for_assignment_of_optional_references.html index 4f06a6c..92b6700 100644 --- a/doc/html/boost_optional/rebinding_semantics_for_assignment_of_optional_references.html +++ b/doc/html/boost_optional/rebinding_semantics_for_assignment_of_optional_references.html @@ -1,11 +1,11 @@ - + Rebinding semantics for assignment of optional references - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+

Rebinding semantics for assignment of optional references @@ -70,7 +70,7 @@ assert(b==3);

- + Rationale

@@ -134,7 +134,7 @@

-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/synopsis.html b/doc/html/boost_optional/synopsis.html index 32472d3..e8ec559 100644 --- a/doc/html/boost_optional/synopsis.html +++ b/doc/html/boost_optional/synopsis.html @@ -1,11 +1,11 @@ - + Synopsis - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -136,7 +136,7 @@
-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/boost_optional/type_requirements.html b/doc/html/boost_optional/type_requirements.html index aae6ec9..4161174 100644 --- a/doc/html/boost_optional/type_requirements.html +++ b/doc/html/boost_optional/type_requirements.html @@ -1,11 +1,11 @@ - + Type requirements - - + + @@ -13,16 +13,16 @@ - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-PrevUpHomeNext +PrevUpHomeNext
-
+
@@ -39,7 +39,7 @@
-

-PrevUpHomeNext +PrevUpHomeNext
diff --git a/doc/html/index.html b/doc/html/index.html index 981800c..14c4e6a 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -1,33 +1,33 @@ - -Chapter 1. Boost.Optional + +Chapter 1. Boost.Optional - + - +
Boost C++ Libraries HomeLibrariesLibraries People FAQ More

-
Next
-
+
Next
+

-Chapter 1. Boost.Optional

+Chapter 1. Boost.Optional

Fernando Luis Cacciola Carballal

-
-
-

+

+
+

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

@@ -71,7 +71,7 @@
Acknowledgments
-
+
@@ -81,15 +81,14 @@

  • - (A) double sqrt(double n - ); -
  • + (A) double sqrt(double n ); +
  • - (B) char get_async_input(); -
  • + (B) char get_async_input(); +
  • - (C) point polygon::get_any_point_effectively_inside(); -
  • + (C) point polygon::get_any_point_effectively_inside(); +

There are different approaches to the issue of not having a value to return. @@ -162,14 +161,12 @@ Clearly, we need a better idiom.

-

-

- +

Last revised: November 20, 2009 at 10:24:28 GMT

Last revised: April 06, 2011 at 20:44:42 GMT


-
Next
+
Next
diff --git a/doc/reference.qbk b/doc/reference.qbk index ea41210..97abcad 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -500,6 +500,23 @@ assert ( *opt1 == static_cast(v) ) ; __SPACE__ +[#reference_optional_operator_equal_factory] + +[: `template optional& optional::operator=( InPlaceFactory const& f );`] +[: `template optional& optional::operator=( TypedInPlaceFactory const& f );`] + +* [*Effect:] Assigns an `optional` with a value of `T` obtained from the +factory. +* [*Postconditions: ] `*this` is [_initialized] and its value is ['directly given] +from the factory `f` (i.e., the value [_is not copied]). +* [*Throws:] Whatever the `T` constructor called by the factory throws. +* [*Notes:] See [link boost_optional.in_place_factories In-Place Factories] +* [*Exception Safety:] Exceptions can only be thrown during the call to +the `T` constructor used by the factory; in that case, the `optional` object +will be left empty. + +__SPACE__ + [#reference_optional_reset_value] [: `void optional::reset( T const& v ) ;`]