Compare commits

...

6 Commits

Author SHA1 Message Date
893d47374f This commit was manufactured by cvs2svn to create tag
'Version_1_31_0'.

[SVN r22162]
2004-02-04 15:24:32 +00:00
cf6c855c37 Merged fixes from trunk to branch
[SVN r22142]
2004-02-03 03:18:14 +00:00
b06ad2b08a *** empty log message ***
[SVN r22075]
2004-01-30 13:37:22 +00:00
64e32e651f Merged fixes from trunk to branch
[SVN r22011]
2004-01-27 20:08:48 +00:00
54264de8f8 Merged fixes from trunk to branch
[SVN r21740]
2004-01-14 20:36:37 +00:00
bcd8ed7e7b This commit was manufactured by cvs2svn to create branch 'RC_1_31_0'.
[SVN r21427]
2003-12-30 12:10:04 +00:00
3 changed files with 33 additions and 40 deletions

View File

@ -921,9 +921,9 @@ assert ( optX != optZ ) ;
<pre>bool operator &lt; ( optional&lt;T&gt; const&amp x, optional&lt;T&gt const&amp y );</pre> <pre>bool operator &lt; ( optional&lt;T&gt; const&amp x, optional&lt;T&gt const&amp y );</pre>
<blockquote> <blockquote>
<p><b>Returns:</b> If both <b>x</b> and <b>y</b> are initialied, <code>(*x &lt; *y)</code>. <p><b>Returns:</b> If <b>y</b> is not initialized, <code>false</code>.
If only x or y is initialized, <code>false</code>. If both are uninitialized, If <b>y</b> is initialized and <b>x</b> is not initialized, <code>true</code>.
<code>false</code>. If both <b>x</b> and <b>y</b> are initialized, <code>(*x &lt; *y)</code>.
</p> </p>
<p><b>Throws:</b> Nothing.</p> <p><b>Throws:</b> Nothing.</p>
<p><b>Notes:</b> Pointers have shallow relational operators while <b>optional</b> has <p><b>Notes:</b> Pointers have shallow relational operators while <b>optional</b> has
@ -1407,37 +1407,39 @@ T <u>is not</u> required to be <a href="http://www.sgi.com/tech/stl/DefaultConst
Henney, David Abrahams, and others I can't recall. </p> Henney, David Abrahams, and others I can't recall. </p>
</blockquote> </blockquote>
<p>Post-formal review:</p> <p>Post-formal review:</p>
<blockquote> <blockquote>
<p>William Kempf carefully considered the originally proposed interface <p>William Kempf carefully considered the originally proposed interface and
and suggested the new interface which is currently used. He also started suggested the new interface which is currently used. He also started and fueled
and fueled the discussion about the analogy optional&lt;&gt;/smart pointer the discussion about the analogy optional&lt;&gt;/smart pointer and about
and about relational operators.<br> relational operators.<br>
Peter Dimov, Joel de Guzman, David Abrahams, Tanton Gibbs and Ian Hanson Peter Dimov, Joel de Guzman, David Abrahams, Tanton Gibbs and Ian Hanson focused
focused on the relational semantics of optional (originally undefined); on the relational semantics of optional (originally undefined); concluding
concluding with the fact that the pointer-like interface doesn't make it with the fact that the pointer-like interface doesn't make it a pointer so
a pointer so it shall have deep relational operators.<br> it shall have deep relational operators.<br>
Augustus Saunders also explored the different relational Augustus Saunders also explored the different relational semantics between
semantics between optional&lt;&gt; and a pointer and developed the optional&lt;&gt; and a pointer and developed the OptionalPointee concept as
OptionalPointee concept as an aid against potential conflicts on generic code.<br> an aid against potential conflicts on generic code.<br>
Joel de Guzman noticed that optional&lt;&gt; can be seen as an Joel de Guzman noticed that optional&lt;&gt; can be seen as an API on top
API on top of variant&lt;T,nil_t&gt;.<br> of variant&lt;T,nil_t&gt;.<br>
Dave Gomboc explained the meaning and usage of the Haskell analog to optional&lt;&gt;: Dave Gomboc explained the meaning and usage of the Haskell analog to optional&lt;&gt;:
the Maybe type constructor (analogy originally pointed out by David Sankel).<br> the Maybe type constructor (analogy originally pointed out by David Sankel).<br>
Other comments were posted by Vincent Finn, Anthony Williams, Ed Brey, Rob Stewart, Other comments were posted by Vincent Finn, Anthony Williams, Ed Brey, Rob
and others.<br> Stewart, and others.<br>
Joel de Guzman made the case for the support of references and helped with the Joel de Guzman made the case for the support of references and helped with
proper semantics.</p> the proper semantics.<br>
Mat Marcus shown the virtues of a value-oriented interface, influencing the
current design, and contributed the idea of &quot;none&quot;.</p>
</blockquote> </blockquote>
<HR> <HR>
<P>Revised December 3, 2003</P> <P>Revised Jannuary 30, 2004</P>
<P>&copy; Copyright boost.org 2003. Permission to copy, use, modify, sell and <P>&copy; Copyright boost.org 2003. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in distribute this document is granted provided this copyright notice appears in
all copies. This document is provided &quot;as is&quot; without express or all copies. This document is provided &quot;as is&quot; without express or implied
implied warranty, and with no claim as to its suitability for any purpose.</P> warranty, and with no claim as to its suitability for any purpose.</P>
<P>Developed by <A HREF="mailto:fernando_cacciola@hotmail.com">Fernando Cacciola</A>, <P>Developed by <A HREF="mailto:fernando_cacciola@hotmail.com">Fernando Cacciola</A>,
the latest version of this file can be found at <A the latest version of this file can be found at <A
HREF="http://www.boost.org">www.boost.org</A>, and the boost discussion list at <A HREF="http://www.boost.org">www.boost.org</A>, and the boost
HREF="http://www.yahoogroups.com/list/boost">www.yahoogroups.com/list/boost</A>. </P> <A HREF="http://www.boost.org/more/mailing_lists.htm#main">discussion lists</A></P>
</BODY> </BODY>
</HTML> </HTML>

View File

@ -426,7 +426,7 @@ class optional : public optional_detail::optional_base<T>
// No-throw (assuming T::~T() doesn't) // No-throw (assuming T::~T() doesn't)
~optional() {} ~optional() {}
#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT #if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
// Assigns from an expression. See corresponding constructor. // Assigns from an expression. See corresponding constructor.
// Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED
template<class Expr> template<class Expr>

View File

@ -485,21 +485,12 @@ void test_throwing_assign_to_initialized( T const* )
BOOST_CHECK(!passed); BOOST_CHECK(!passed);
#ifdef BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
// opt0 was left unmodified
check_is_pending_dtor( ARG(T) );
check_is_not_pending_copy( ARG(T) );
check_instance_count(count, ARG(T) );
check_initialized(opt0);
#else
// opt0 was left uninitialized // opt0 was left uninitialized
-- count ; -- count ;
check_is_not_pending_dtor( ARG(T) ); check_is_not_pending_dtor( ARG(T) );
check_is_not_pending_copy( ARG(T) ); check_is_not_pending_copy( ARG(T) );
check_instance_count(count, ARG(T) ); check_instance_count(count, ARG(T) );
check_uninitialized(opt0); check_uninitialized(opt0);
#endif
} }
// //