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 7434cf9..ea12e75 100644 --- a/doc/html/boost_optional/a_note_about_optional_bool_.html +++ b/doc/html/boost_optional/a_note_about_optional_bool_.html @@ -3,7 +3,7 @@ A note about optional<bool> - + @@ -22,7 +22,7 @@
PrevUpHomeNext
-
+

A note about optional<bool> @@ -54,11 +54,11 @@ { optional<bool> v = try(); - // The following intended to pass the value of 'v' to foo(): - foo(v); - // But instead, the initialization state is passed - // due to a typo: it should have been foo(*v). -} + // The following intended to pass the value of 'v' to foo(): + foo(v); + // But instead, the initialization state is passed + // due to a typo: it should have been foo(*v). +}

The only implicit conversion is to bool, diff --git a/doc/html/boost_optional/acknowledgments.html b/doc/html/boost_optional/acknowledgments.html index 935ed0b..e67f2ff 100644 --- a/doc/html/boost_optional/acknowledgments.html +++ b/doc/html/boost_optional/acknowledgments.html @@ -3,7 +3,7 @@ Acknowledgments - + @@ -21,16 +21,16 @@

PrevUpHome
-
+
-

- - Pre-formal +

+ + Pre-formal review

-
    +
    • Peter Dimov suggested the name 'optional', and was the first to point out the need for aligned storage. @@ -64,12 +64,12 @@ Henney, David Abrahams, and others I can't recall.
    -

    - - Post-formal +

    + + Post-formal review

    -
      +
      • William Kempf carefully considered the originally proposed interface and suggested the new interface which is currently used. He also started and diff --git a/doc/html/boost_optional/dependencies_and_portability.html b/doc/html/boost_optional/dependencies_and_portability.html index 26c78f9..39828d4 100644 --- a/doc/html/boost_optional/dependencies_and_portability.html +++ b/doc/html/boost_optional/dependencies_and_portability.html @@ -3,7 +3,7 @@ Dependencies and Portability - + @@ -22,7 +22,7 @@
        PrevUpHomeNext
        -
        +

        Dependencies and Portability diff --git a/doc/html/boost_optional/detailed_semantics.html b/doc/html/boost_optional/detailed_semantics.html index 223d0c9..40d873a 100644 --- a/doc/html/boost_optional/detailed_semantics.html +++ b/doc/html/boost_optional/detailed_semantics.html @@ -3,7 +3,7 @@ Detailed Semantics - + @@ -22,7 +22,7 @@
        PrevUpHomeNext
        -
        +
        @@ -31,7 +31,7 @@ type, in the sequel, those entries whose semantic depends on T being of reference type or not will be distinguished using the following convention:

        -
          +
          • If the entry reads: optional<T(not a ref)>, the @@ -63,9 +63,9 @@

            space

            -

            - - optional +

            + + optional class member functions

            @@ -74,7 +74,7 @@

            optional<T>::optional();

            -
              +
              • Effect: Default-Constructs an optional.
              • @@ -89,7 +89,7 @@ called.
              • - Example: + Example:
                optional<T> def ;
                 assert ( !def ) ;
                 
                @@ -101,7 +101,7 @@

                optional<T>::optional( none_t );

                -
                  +
                  • Effect: Constructs an optional uninitialized. @@ -118,7 +118,7 @@ The expression boost::none denotes an instance of boost::none_t that can be used as the parameter.
                  • - Example: + Example:
                    #include <boost/none.hpp>
                     optional<T> n(none) ;
                     assert ( !n ) ;
                    @@ -131,7 +131,7 @@
                     

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

                    -
                      +
                      • Effect: Directly-Constructs an optional.
                      • @@ -157,7 +157,7 @@ has no effect.
                      • - Example: + Example:
                        T v;
                         optional<T> opt(v);
                         assert ( *opt == v ) ;
                        @@ -170,7 +170,7 @@
                         

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

                        -
                          +
                          • Effect: Directly-Constructs an optional.
                          • @@ -183,13 +183,13 @@ Throws: Nothing.
                          • - Example: + Example:
                            T v;
                             T& vref = v ;
                             optional<T&> opt(vref);
                             assert ( *opt == v ) ;
                            -++ v ; // mutate referee
                            -assert (*opt == v);
                            +++ v ; // mutate referee
                            +assert (*opt == v);
                             
                          @@ -203,7 +203,7 @@ optional<T&> ::optional( bool condition, T& v ) ;

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

                          @@ -213,7 +213,7 @@ optional<T&> ::optional( T& v )

                          -
                          • +
                            • otherwise, same as:

                            @@ -228,7 +228,7 @@

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

                            -
                              +
                              • Effect: Copy-Constructs an optional.
                              • @@ -256,7 +256,7 @@ has no effect.
                              • - Example: + Example:
                                optional<T> uninit ;
                                 assert (!uninit);
                                 
                                @@ -277,7 +277,7 @@
                                 

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

                                -
                                  +
                                  • Effect: Copy-Constructs an optional.
                                  • @@ -299,7 +299,7 @@ will reefer to the same object (they alias).
                                  • - Example: + Example:
                                    optional<T&> uninit ;
                                     assert (!uninit);
                                     
                                    @@ -327,7 +327,7 @@
                                             template<U> explicit optional<T
                                             (not a ref)>::optional( optional<U> const& rhs );
                                           

                            -
                              +
                              • Effect: Copy-Constructs an optional.
                              • @@ -359,7 +359,7 @@ has no effect.
                              • - Example: + Example:
                                optional<double> x(123.4);
                                 assert ( *x == 123.4 ) ;
                                 
                                @@ -381,7 +381,7 @@
                                         explicit optional<T
                                         (not a ref)>::optional( TypedInPlaceFactory const& f );
                                       

                              -
                                +
                                • Effect: Constructs an optional with a value of T obtained @@ -407,14 +407,14 @@ effect.
                                • - Example: + Example:
                                  class C { C ( char, double, std::string ) ; } ;
                                   
                                   C v('A',123.4,"hello");
                                   
                                  -optional<C> x( in_place   ('A', 123.4, "hello") ); // InPlaceFactory used
                                  -optional<C> y( in_place<C>('A', 123.4, "hello") ); // TypedInPlaceFactory used
                                  -
                                  +optional<C> x( in_place   ('A', 123.4, "hello") ); // InPlaceFactory used
                                  +optional<C> y( in_place<C>('A', 123.4, "hello") ); // TypedInPlaceFactory used
                                  +
                                   assert ( *x == v ) ;
                                   assert ( *y == v ) ;
                                   
                                  @@ -430,7 +430,7 @@ rhs ) ;

                                -
                                  +
                                  • Effect: Assigns the value rhs to an optional.
                                  • @@ -455,7 +455,7 @@ copy constructor fails, *this is left properly uninitialized.
                                  • - Example: + Example:
                                    T x;
                                     optional<T> def ;
                                     optional<T> opt(x) ;
                                    @@ -477,7 +477,7 @@
                                             rhs )
                                             ;
                                           

                                  -
                                    +
                                    • Effect: (Re)binds the wrapped reference.
                                    • @@ -486,12 +486,12 @@ same object referenced by rhs.
                                    • - Notes: If *this was initialized, is is rebound + Notes: If *this was initialized, it is rebound to the new object. See here for details on this behavior.
                                    • - Example: + Example:
                                      int a = 1 ;
                                       int b = 2 ;
                                       T& ra = a ;
                                      @@ -499,14 +499,14 @@
                                       optional<int&> def ;
                                       optional<int&> opt(ra) ;
                                       
                                      -def = rb ; // binds 'def' to 'b' through 'rb'
                                      -assert ( *def == b ) ;
                                      -*def = a ; // changes the value of 'b' to a copy of the value of 'a'
                                      -assert ( b == a ) ;
                                      +def = rb ; // binds 'def' to 'b' through 'rb'
                                      +assert ( *def == b ) ;
                                      +*def = a ; // changes the value of 'b' to a copy of the value of 'a'
                                      +assert ( b == a ) ;
                                       int c = 3;
                                       int& rc = c ;
                                      -opt = rc ; // REBINDS to 'c' through 'rc'
                                      -c = 4 ;
                                      +opt = rc ; // REBINDS to 'c' through 'rc'
                                      +c = 4 ;
                                       assert ( *opt == 4 ) ;
                                       
                                    • @@ -521,7 +521,7 @@ rhs ) ;

                                    -
                                      +
                                      • Effect: Assigns another optional to an optional.
                                      • @@ -555,15 +555,15 @@ copy constructor fails, *this is left properly uninitialized.
                                      • - Example: + Example:
                                        T v;
                                         optional<T> opt(v);
                                         optional<T> def ;
                                         
                                         opt = def ;
                                         assert ( !def ) ;
                                        -// previous value (copy of 'v') destroyed from within 'opt'.
                                        -
                                        +// previous value (copy of 'v') destroyed from within 'opt'. +

                      @@ -575,7 +575,7 @@ rhs ) ;

                    -
                      +
                      • Effect: (Re)binds thee wrapped reference.
                      • @@ -585,12 +585,13 @@ object).
                      • - Notes: If *this was initialized and so is *rhs, this - is is rebound to the new object. See here + Notes: If *this was initialized and so is *rhs, + *this + is rebound to the new object. See here for details on this behavior.
                      • - Example: + Example:
                        int a = 1 ;
                         int b = 2 ;
                         T& ra = a ;
                        @@ -599,15 +600,15 @@
                         optional<int&> ora(ra) ;
                         optional<int&> orb(rb) ;
                         
                        -def = orb ; // binds 'def' to 'b' through 'rb' wrapped within 'orb'
                        -assert ( *def == b ) ;
                        -*def = ora ; // changes the value of 'b' to a copy of the value of 'a'
                        -assert ( b == a ) ;
                        +def = orb ; // binds 'def' to 'b' through 'rb' wrapped within 'orb'
                        +assert ( *def == b ) ;
                        +*def = ora ; // changes the value of 'b' to a copy of the value of 'a'
                        +assert ( b == a ) ;
                         int c = 3;
                         int& rc = c ;
                         optional<int&> orc(rc) ;
                        -ora = orc ; // REBINDS ora to 'c' through 'rc'
                        -c = 4 ;
                        +ora = orc ; // REBINDS ora to 'c' through 'rc'
                        +c = 4 ;
                         assert ( *ora == 4 ) ;
                         
                      • @@ -622,7 +623,7 @@ rhs ) ;

                      -
                        +
                        • Effect: Assigns another convertible optional to an optional. @@ -662,7 +663,7 @@ converting constructor fails, *this is left properly uninitialized.
                        • - Example: + Example:
                          T v;
                           optional<T> opt0(v);
                           optional<U> opt1;
                          @@ -687,7 +688,7 @@
                                   const&
                                   f );
                                 

                        -
                          +
                          • Effect: Assigns an optional with a value of T obtained @@ -720,7 +721,7 @@ void optional<T (not a ref)>::reset( T const& v ) ;

                          -
                          • +
                            • Deprecated: same as operator= ( T const& v) @@ -732,7 +733,7 @@

                              void optional<T>::reset() ;

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

                                @@ -765,7 +766,7 @@ (not a ref)> &) ;

                              -
                                +
                                • Requirements: *this is initialized
                                • @@ -781,7 +782,7 @@ BOOST_ASSERT().
                                • - Example: + Example:
                                  T v ;
                                   optional<T> opt ( v );
                                   T const& u = *opt;
                                  @@ -818,7 +819,7 @@
                                           (not a ref)>&
                                           o, T& default ) ;
                                         

                                -
                                  +
                                  • Returns: A reference to the contained value, if any, or default. @@ -827,7 +828,7 @@ Throws: Nothing.
                                  • - Example: + Example:
                                    T v, z ;
                                     optional<T> def;
                                     T const& y = def.get_value_or(z);
                                    @@ -867,7 +868,7 @@
                                             inline T& get ( optional<T&>
                                             &) ;
                                           

                                  -
                                    +
                                    • Requirements: *this is initialized
                                    • @@ -883,7 +884,7 @@ BOOST_ASSERT().
                                    • - Example: + Example:
                                      T v ;
                                       T& vref = v ;
                                       optional<T&> opt ( vref );
                                      @@ -916,7 +917,7 @@
                                               (not a ref)>
                                               &) ;
                                             

                                    -
                                      +
                                      • Returns: If *this is initialized, a pointer to the contained value; else 0 (null). @@ -930,7 +931,7 @@ so you should not hold nor delete this pointer
                                      • - Example: + Example:
                                        T v;
                                         optional<T> opt(v);
                                         optional<T> const copt(v);
                                        @@ -953,7 +954,7 @@
                                                 T*
                                                 optional<T (not a ref)>::operator ->() ;
                                               

                                      -
                                        +
                                        • Requirements: *this is initialized.
                                        • @@ -968,7 +969,7 @@ BOOST_ASSERT().
                                        • - Example: + Example:
                                          struct X { int mdata ; } ;
                                           X x ;
                                           optional<X> opt (x);
                                          @@ -982,16 +983,16 @@
                                           

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

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

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

                                              -
                                                +
                                                • Returns: If *this is uninitialized, true; else false. @@ -1020,13 +1021,13 @@ in certain boolean contexts.
                                                • - Example: + Example:
                                                  optional<T> opt ;
                                                   assert ( !opt );
                                                   *opt = some_T ;
                                                   
                                                  -// Notice the "double-bang" idiom here.
                                                  -assert ( !!opt ) ;
                                                  +// Notice the "double-bang" idiom here.
                                                  +assert ( !!opt ) ;
                                                   
                                                @@ -1037,30 +1038,18 @@ bool optional<T>::is_initialized() const ;

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

                                              space

                                              -

                                              - - Free functions +

                                              + + Free + functions

                                              space @@ -1068,17 +1057,17 @@

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

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

                                            @@ -1087,14 +1076,14 @@

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

                                            -
                                              +
                                              • Returns: optional<T>(condition,v) for the deduced type T of v.
                                              • - Example: + Example:
                                                optional<double> calculate_foo()
                                                 {
                                                   double val = compute_foo();
                                                @@ -1116,7 +1105,7 @@
                                                         const&
                                                         y );
                                                       

                                              -
                                                +
                                                • Returns: If both x and y are initialized, @@ -1137,7 +1126,7 @@ instead
                                                • - Example: + Example:
                                                  T x(12);
                                                   T y(12);
                                                   T z(21);
                                                  @@ -1147,18 +1136,18 @@
                                                   optional<T> optY(y);
                                                   optional<T> optZ(z);
                                                   
                                                  -// Identity always hold
                                                  -assert ( def0 == def0 );
                                                  +// Identity always hold
                                                  +assert ( def0 == def0 );
                                                   assert ( optX == optX );
                                                   
                                                  -// Both uninitialized compare equal
                                                  -assert ( def0 == def1 );
                                                  +// Both uninitialized compare equal
                                                  +assert ( def0 == def1 );
                                                   
                                                  -// Only one initialized compare unequal.
                                                  -assert ( def0 != optX );
                                                  +// Only one initialized compare unequal.
                                                  +assert ( def0 != optX );
                                                   
                                                  -// Both initialized compare as (*lhs == *rhs)
                                                  -assert ( optX == optY ) ;
                                                  +// Both initialized compare as (*lhs == *rhs)
                                                  +assert ( optX == optY ) ;
                                                   assert ( optX != optZ ) ;
                                                   
                                                • @@ -1172,7 +1161,7 @@ const& y );

                                                -
                                                  +
                                                  • Returns: If y is not initialized, false. @@ -1194,25 +1183,25 @@ instead.
                                                  • - Example: + Example:
                                                    T x(12);
                                                     T y(34);
                                                     optional<T> def ;
                                                     optional<T> optX(x);
                                                     optional<T> optY(y);
                                                     
                                                    -// Identity always hold
                                                    -assert ( !(def < def) );
                                                    +// Identity always hold
                                                    +assert ( !(def < def) );
                                                     assert ( optX == optX );
                                                     
                                                    -// Both uninitialized compare equal
                                                    -assert ( def0 == def1 );
                                                    +// Both uninitialized compare equal
                                                    +assert ( def0 == def1 );
                                                     
                                                    -// Only one initialized compare unequal.
                                                    -assert ( def0 != optX );
                                                    +// Only one initialized compare unequal.
                                                    +assert ( def0 != optX );
                                                     
                                                    -// Both initialized compare as (*lhs == *rhs)
                                                    -assert ( optX == optY ) ;
                                                    +// Both initialized compare as (*lhs == *rhs)
                                                    +assert ( optX == optY ) ;
                                                     assert ( optX != optZ ) ;
                                                     
                                                  • @@ -1226,7 +1215,7 @@ const& y );

                                                  -
                                                    +
                                                    • Returns: !( x == @@ -1245,7 +1234,7 @@ const& y );

                                                    -
                                                      +
                                                      • Returns: ( y < @@ -1265,7 +1254,7 @@ const& y );

                                                      -
                                                        +
                                                        • Returns: !( y<x ); @@ -1284,7 +1273,7 @@ const& y );

                                                        -
                                                          +
                                                          • Returns: !( x<y ); @@ -1301,7 +1290,7 @@ ( optional<T>& x, optional<T>& y );

                                                          -
                                                            +
                                                            • Effect: If both x and y are initialized, @@ -1331,7 +1320,7 @@ If only one is initialized, it has the same basic guarantee as optional<T>::reset( T const& ).
                                                            • - Example: + Example:
                                                              T x(12);
                                                               T y(21);
                                                               optional<T> def0 ;
                                                              @@ -1339,14 +1328,14 @@
                                                               optional<T> optX(x);
                                                               optional<T> optY(y);
                                                               
                                                              -boost::swap(def0,def1); // no-op
                                                              -
                                                              +boost::swap(def0,def1); // no-op
                                                              +
                                                               boost::swap(def0,optX);
                                                               assert ( *def0 == x );
                                                               assert ( !optX );
                                                               
                                                              -boost::swap(def0,optX); // Get back to original values
                                                              -
                                                              +boost::swap(def0,optX); // Get back to original values
                                                              +
                                                               boost::swap(optX,optY);
                                                               assert ( *optX == y );
                                                               assert ( *optY == x );
                                                              diff --git a/doc/html/boost_optional/development.html b/doc/html/boost_optional/development.html
                                                              index 4c870d6..d95699d 100644
                                                              --- a/doc/html/boost_optional/development.html
                                                              +++ b/doc/html/boost_optional/development.html
                                                              @@ -3,7 +3,7 @@
                                                               
                                                               Development
                                                               
                                                              -
                                                              +
                                                               
                                                               
                                                               
                                                              @@ -22,7 +22,7 @@
                                                               
                                                              PrevUpHomeNext
                                                              -
                                                              + -
                                                              +
                                                              @@ -110,7 +110,7 @@

                                                              Discriminated-union:

                                                              -
                                                                +
                                                                • deep-copy semantics: copies of the variant implies copies of the value. @@ -141,7 +141,7 @@

                                                                  Single-element container:

                                                                  -
                                                                    +
                                                                    • deep-copy semantics: copies of the container implies copies of the value. @@ -168,7 +168,7 @@
                                                                  -
                                                                  +
                                                                  @@ -193,7 +193,7 @@ We can draw from the purpose of optional<T> the required basic semantics:

                                                                  -
                                                            -
                                                            +

                                                            Optional local variables @@ -65,12 +65,12 @@
                                                            optional<string> name ;
                                                             if ( database.open() )
                                                             {
                                                            -    name.reset ( database.lookup(employer_name) ) ;
                                                            +    name = database.lookup(employer_name) ;
                                                             }
                                                             else
                                                             {
                                                                 if ( can_ask_user )
                                                            -        name.reset ( user.ask(employer_name) ) ;
                                                            +        name = user.ask(employer_name) ;
                                                             }
                                                             
                                                             if ( name )
                                                            @@ -78,7 +78,7 @@
                                                             else print("employer's name not found!");
                                                             

                                                            -
                                                            +

                                                            Optional data members @@ -89,14 +89,14 @@ figure() { - // data member 'm_clipping_rect' is uninitialized at this point. - } + // data member 'm_clipping_rect' is uninitialized at this point. + } void clip_in_rect ( rect const& rect ) { .... - m_clipping_rect.reset ( rect ) ; // initialized here. - } + m_clipping_rect = rect ; // initialized here. + } void draw ( canvas& cvs ) { @@ -106,8 +106,8 @@ cvs.drawXXX(..); } - // this can return NULL. - rect const* get_clipping_rect() { return get_pointer(m_clipping_rect); } + // this can return NULL. + rect const* get_clipping_rect() { return get_pointer(m_clipping_rect); } private : @@ -116,7 +116,7 @@ };

                                        -
                                        +

                                        Bypassing expensive unnecessary default construction diff --git a/doc/html/boost_optional/exception_safety_guarantees.html b/doc/html/boost_optional/exception_safety_guarantees.html index 98b37fa..9516647 100644 --- a/doc/html/boost_optional/exception_safety_guarantees.html +++ b/doc/html/boost_optional/exception_safety_guarantees.html @@ -3,7 +3,7 @@ Exception Safety Guarantees - + @@ -22,7 +22,7 @@
                                        PrevUpHomeNext
                                        -
                                        +

                                        Exception Safety Guarantees @@ -31,7 +31,7 @@ Because of the current implementation (see Implementation Notes), all of the assignment methods:

                                        -
                                          +
                                          • optional<T>::operator= ( optional<T> const& )
                                          • @@ -52,7 +52,7 @@ )
                                          • - optional<T>:::reset ( T const&) + optional<T>::reset ( T const&)

                                          @@ -64,7 +64,7 @@

                                          On the other hand, the uninitializing methods:

                                          -
                                            +
                                            • optional<T>::operator= ( detail::none_t )
                                            • @@ -84,10 +84,10 @@ know that optional's assignment and reset has the same guarantees.

                                              -
                                              //
                                              -// Case 1: Exception thrown during assignment.
                                              -//
                                              -T v0(123);
                                              +
                                              //
                                              +// Case 1: Exception thrown during assignment.
                                              +//
                                              +T v0(123);
                                               optional<T> opt0(v0);
                                               try
                                               {
                                              @@ -95,37 +95,37 @@
                                                   optional<T> opt1(v1);
                                                   opt0 = opt1 ;
                                               
                                              -    // If no exception was thrown, assignment succeeded.
                                              -    assert( *opt0 == v1 ) ;
                                              +    // If no exception was thrown, assignment succeeded.
                                              +    assert( *opt0 == v1 ) ;
                                               }
                                               catch(...)
                                               {
                                              -    // If any exception was thrown, 'opt0' is reset to uninitialized.
                                              -    assert( !opt0 ) ;
                                              +    // If any exception was thrown, 'opt0' is reset to uninitialized.
                                              +    assert( !opt0 ) ;
                                               }
                                               
                                              -//
                                              -// Case 2: Exception thrown during reset(v)
                                              -//
                                              -T v0(123);
                                              +//
                                              +// Case 2: Exception thrown during reset(v)
                                              +//
                                              +T v0(123);
                                               optional<T> opt(v0);
                                               try
                                               {
                                                   T v1(456);
                                                   opt.reset ( v1 ) ;
                                               
                                              -    // If no exception was thrown, reset succeeded.
                                              -    assert( *opt == v1 ) ;
                                              +    // If no exception was thrown, reset succeeded.
                                              +    assert( *opt == v1 ) ;
                                               }
                                               catch(...)
                                               {
                                              -    // If any exception was thrown, 'opt' is reset to uninitialized.
                                              -    assert( !opt ) ;
                                              +    // If any exception was thrown, 'opt' is reset to uninitialized.
                                              +    assert( !opt ) ;
                                               }
                                               
                                              -

                                              - - Swap +

                                              + + Swap

                                              void swap( optional<T>&, diff --git a/doc/html/boost_optional/implementation_notes.html b/doc/html/boost_optional/implementation_notes.html index 08374b1..4d004bb 100644 --- a/doc/html/boost_optional/implementation_notes.html +++ b/doc/html/boost_optional/implementation_notes.html @@ -3,7 +3,7 @@ Implementation Notes - + @@ -22,7 +22,7 @@

                                              PrevUpHomeNext
                                              -
                                              +
                                              diff --git a/doc/html/boost_optional/in_place_factories.html b/doc/html/boost_optional/in_place_factories.html index 87ee45c..9dc6374 100644 --- a/doc/html/boost_optional/in_place_factories.html +++ b/doc/html/boost_optional/in_place_factories.html @@ -3,7 +3,7 @@ In-Place Factories - + @@ -22,7 +22,7 @@
                                              PrevUpHomeNext
                                              -
                                              +
                                              @@ -36,7 +36,7 @@

                                              struct X
                                               {
                                              -    X ( int, std:::string ) ;
                                              +    X ( int, std::string ) ;
                                               } ;
                                               
                                               class W
                                              @@ -50,8 +50,8 @@
                                               
                                               void foo()
                                               {
                                              -    // Temporary object created.
                                              -    W ( X(123,"hello") ) ;
                                              +    // Temporary object created.
                                              +    W ( X(123,"hello") ) ;
                                               }
                                               

                                              @@ -71,9 +71,9 @@ void foo() { - // Wrapped object constructed in-place - // No temporary created. - W (123,"hello") ; + // Wrapped object constructed in-place + // No temporary created. + W (123,"hello") ; }

                                              @@ -119,15 +119,15 @@ void foo() { - // Wrapped object constructed in-place via a TypedInPlaceFactory. - // No temporary created. - W ( TypedInPlaceFactory2<X,int,std::string>(123,"hello")) ; + // Wrapped object constructed in-place via a TypedInPlaceFactory. + // No temporary created. + W ( TypedInPlaceFactory2<X,int,std::string>(123,"hello")) ; }

                    The factories are divided in two groups:

                    -
                      +
                      • TypedInPlaceFactories: those which take the target type as a primary template parameter. @@ -170,9 +170,9 @@ void foo() { - // Wrapped object constructed in-place via a InPlaceFactory. - // No temporary created. - W ( in_place(123,"hello") ) ; + // Wrapped object constructed in-place via a InPlaceFactory. + // No temporary created. + W ( in_place(123,"hello") ) ; }

                        diff --git a/doc/html/boost_optional/optional_references.html b/doc/html/boost_optional/optional_references.html index d50412b..c5cbdcd 100644 --- a/doc/html/boost_optional/optional_references.html +++ b/doc/html/boost_optional/optional_references.html @@ -3,7 +3,7 @@ Optional references - + @@ -22,7 +22,7 @@

                        PrevUpHomeNext
                        -
                        +
                        @@ -35,7 +35,7 @@ However, since references are not real objects some restrictions apply and some operations are not available in this case:

                        -
                          +
                          • Converting constructors
                          • @@ -57,7 +57,7 @@ treats it wrapped pseudo-object much as a real value, a true real reference is stored so aliasing will ocurr:

                            -
                              +
                              • Copies of optional<T&> will copy the references but all these references will nonetheless reefer 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 5272f40..71c9b1c 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 @@ -3,7 +3,7 @@ Rebinding semantics for assignment of optional references - + @@ -22,7 +22,7 @@
                                PrevUpHomeNext
                                -
                                +

                                Rebinding semantics for assignment of optional references @@ -36,9 +36,9 @@ int& rx = x ; optional<int&> ora ; optional<int&> orb(x) ; -ora = orb ; // now 'ora' is bound to 'x' through 'rx' -*ora = 2 ; // Changes value of 'x' through 'ora' -assert(x==2); +ora = orb ; // now 'ora' is bound to 'x' through 'rx' +*ora = 2 ; // Changes value of 'x' through 'ora' +assert(x==2);

                                If you assign to a bare C++ reference, the assignment is forwarded to the referenced @@ -48,11 +48,11 @@ int& ra = a ; int b = 2 ; int& rb = b ; -ra = rb ; // Changes the value of 'a' to 'b' -assert(a==b); +ra = rb ; // Changes the value of 'a' to 'b' +assert(a==b); b = 3 ; -assert(ra!=b); // 'ra' is not rebound to 'b' - +assert(ra!=b); // 'ra' is not rebound to 'b' +

                                Now, if you assign to an initialized optional<T&>, the effect is to rebind to the new object @@ -64,14 +64,14 @@ int& rb = b ; optional<int&> ora(ra) ; optional<int&> orb(rb) ; -ora = orb ; // 'ora' is rebound to 'b' -*ora = 3 ; // Changes value of 'b' (not 'a') -assert(a==1); -assert(b==3); +ora = orb ; // 'ora' is rebound to 'b' +*ora = 3 ; // Changes value of 'b' (not 'a') +assert(a==1); +assert(b==3); -

                                - - Rationale +

                                + + Rationale

                                Rebinding semantics for the assignment of initialized diff --git a/doc/html/boost_optional/synopsis.html b/doc/html/boost_optional/synopsis.html index 8b08308..52a90ba 100644 --- a/doc/html/boost_optional/synopsis.html +++ b/doc/html/boost_optional/synopsis.html @@ -3,7 +3,7 @@ Synopsis - + @@ -22,7 +22,7 @@

                                PrevUpHomeNext
                                -
                                +
                                @@ -35,16 +35,16 @@ { public : - // (If T is of reference type, the parameters and results by reference are by value) - + // (If T is of reference type, the parameters and results by reference are by value) + optional () ; R optional ( none_t ) ; R optional ( T const& v ) ; R - // [new in 1.34] - optional ( bool condition, T const& v ) ; R + // [new in 1.34] + optional ( bool condition, T const& v ) ; R optional ( optional const& rhs ) ; R @@ -54,7 +54,7 @@ template<class TypedInPlaceFactory> explicit optional ( TypedInPlaceFactory const& f ) ; R - optional& operator = ( none_t ) ; + optional& operator = ( none_t ) ; optional& operator = ( T const& v ) ; R @@ -69,8 +69,8 @@ T const& get() const ; R T& get() ; R - // [new in 1.34] - T const& get_value_or( T const& default ) const ; R + // [new in 1.34] + T const& get_value_or( T const& default ) const ; R T const* operator ->() const ; R T* operator ->() ; R @@ -85,16 +85,16 @@ bool operator!() const ; R - // deprecated methods - - // (deprecated) - void reset() ; R + // deprecated methods - // (deprecated) - void reset ( T const& ) ; R + // (deprecated) + void reset() ; R - // (deprecated) - bool is_initialized() const ; R + // (deprecated) + void reset ( T const& ) ; R + + // (deprecated) + bool is_initialized() const ; R }; @@ -110,14 +110,14 @@ template<class T> inline bool operator >= ( optional<T> const& x, optional<T> const& y ) ; R -// [new in 1.34] -template<class T> inline optional<T> make_optional ( T const& v ) ; R +// [new in 1.34] +template<class T> inline optional<T> make_optional ( T const& v ) ; R -// [new in 1.34] -template<class T> inline optional<T> make_optional ( bool condition, T const& v ) ; R +// [new in 1.34] +template<class T> inline optional<T> make_optional ( bool condition, T const& v ) ; R -// [new in 1.34] -template<class T> inline T const& get_optional_value_or ( optional<T> const& opt, T const& default ) ; R +// [new in 1.34] +template<class T> inline T const& get_optional_value_or ( optional<T> const& opt, T const& default ) ; R template<class T> inline T const& get ( optional<T> const& opt ) ; R @@ -133,8 +133,8 @@ template<class T> inline void swap( optional<T>& x, optional<T>& y ) ; R -} // namespace boost - +} // namespace boost +
                                diff --git a/doc/html/boost_optional/type_requirements.html b/doc/html/boost_optional/type_requirements.html index 4161174..17a7c51 100644 --- a/doc/html/boost_optional/type_requirements.html +++ b/doc/html/boost_optional/type_requirements.html @@ -3,7 +3,7 @@ Type requirements - + @@ -22,7 +22,7 @@
                                PrevUpHomeNext
                                -
                                +
                                diff --git a/doc/html/index.html b/doc/html/index.html index cdd3189..39160e0 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,7 +3,7 @@ Chapter 1. Boost.Optional - + @@ -27,7 +27,7 @@
                                -

                                +

                                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
                                -
                                +
                                @@ -79,7 +79,7 @@ Consider these functions which should return a value but which might not have a value to return:

                                -
                                  +
                                  • (A) double sqrt(double n );
                                  • @@ -163,7 +163,7 @@
                                - +

                                Last revised: April 07, 2011 at 21:02:08 GMT

                                Last revised: February 16, 2013 at 19:42:23 GMT