Compare commits

...

6 Commits

Author SHA1 Message Date
aa6713ff54 This commit was manufactured by cvs2svn to create tag 'minmax'.
[SVN r22393]
2004-02-26 10:35:28 +00:00
0109fabef4 Fixed test for bcc5.6.4 weak overload resolution
[SVN r22138]
2004-02-02 15:40:12 +00:00
dce592e3b2 Added acknowldegment to Mat Marcus
[SVN r22074]
2004-01-30 13:17:22 +00:00
05045f5be7 Fixed overload resolution problem with operator= in bcc5.6.4
[SVN r21999]
2004-01-27 13:46:50 +00:00
8d85b4c47b Fixed documentation for operator<
[SVN r21738]
2004-01-14 20:22:56 +00:00
3ca0557a7c Sync with V1 Jamfile.
[SVN r21563]
2004-01-09 11:28:42 +00:00
4 changed files with 47 additions and 59 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>
<blockquote>
<p><b>Returns:</b> If both <b>x</b> and <b>y</b> are initialied, <code>(*x &lt; *y)</code>.
If only x or y is initialized, <code>false</code>. If both are uninitialized,
<code>false</code>.
<p><b>Returns:</b> If <b>y</b> is not initialized, <code>false</code>.
If <b>y</b> is initialized and <b>x</b> is not initialized, <code>true</code>.
If both <b>x</b> and <b>y</b> are initialized, <code>(*x &lt; *y)</code>.
</p>
<p><b>Throws:</b> Nothing.</p>
<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>
</blockquote>
<p>Post-formal review:</p>
<blockquote>
<p>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&lt;&gt;/smart pointer
and about relational operators.<br>
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.<br>
Augustus Saunders also explored the different relational
semantics between optional&lt;&gt; and a pointer and developed the
OptionalPointee concept as an aid against potential conflicts on generic code.<br>
Joel de Guzman noticed that optional&lt;&gt; can be seen as an
API on top of variant&lt;T,nil_t&gt;.<br>
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>
Other comments were posted by Vincent Finn, Anthony Williams, Ed Brey, Rob Stewart,
and others.<br>
Joel de Guzman made the case for the support of references and helped with the
proper semantics.</p>
<blockquote>
<p>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&lt;&gt;/smart pointer and about
relational operators.<br>
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.<br>
Augustus Saunders also explored the different relational semantics between
optional&lt;&gt; and a pointer and developed the OptionalPointee concept as
an aid against potential conflicts on generic code.<br>
Joel de Guzman noticed that optional&lt;&gt; can be seen as an API on top
of variant&lt;T,nil_t&gt;.<br>
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>
Other comments were posted by Vincent Finn, Anthony Williams, Ed Brey, Rob
Stewart, and others.<br>
Joel de Guzman made the case for the support of references and helped with
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>
<HR>
<P>Revised December 3, 2003</P>
<P>&copy; Copyright boost.org 2003. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in
all copies. This document is provided &quot;as is&quot; without express or
implied warranty, and with no claim as to its suitability for any purpose.</P>
<P>Revised Jannuary 30, 2004</P>
<P>&copy; Copyright boost.org 2003. Permission to copy, use, modify, sell and
distribute this document is granted provided this copyright notice appears in
all copies. This document is provided &quot;as is&quot; without express or implied
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>,
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.yahoogroups.com/list/boost">www.yahoogroups.com/list/boost</A>. </P>
HREF="http://www.boost.org">www.boost.org</A>, and the boost
<A HREF="http://www.boost.org/more/mailing_lists.htm#main">discussion lists</A></P>
</BODY>
</HTML>

View File

@ -426,7 +426,7 @@ class optional : public optional_detail::optional_base<T>
// No-throw (assuming T::~T() doesn't)
~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.
// Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED
template<class Expr>

View File

@ -14,26 +14,21 @@
import testing ;
project
: source-location $(BOOST_ROOT)
;
{
test-suite optional :
[ run libs/optional/test/optional_test.cpp ]
[ run libs/optional/test/optional_test_tie.cpp ]
[ run libs/optional/test/optional_test_references.cpp ]
[ run libs/optional/test/optional_test_inplace.cpp ]
[ compile-fail libs/optional/test/optional_test_fail1.cpp ]
[ compile-fail libs/optional/test/optional_test_fail2.cpp ]
[ compile-fail libs/optional/test/optional_test_fail3a.cpp ]
[ compile-fail libs/optional/test/optional_test_fail3b.cpp ]
[ compile-fail libs/optional/test/optional_test_references_fail1a.cpp ]
[ compile-fail libs/optional/test/optional_test_references_fail1b.cpp ]
[ compile-fail libs/optional/test/optional_test_references_fail1c.cpp ]
[ compile-fail libs/optional/test/optional_test_references_fail2.cpp ]
[ compile-fail libs/optional/test/optional_test_references_fail3.cpp ]
[ compile-fail libs/optional/test/optional_test_references_fail4.cpp ]
[ compile-fail libs/optional/test/optional_test_inplace_fail.cpp ]
[ compile-fail libs/optional/test/optional_test_inplace_fail2.cpp ]
[ run optional_test.cpp ]
[ run optional_test_tie.cpp ]
[ run optional_test_ref.cpp ]
[ run optional_test_inplace.cpp ]
[ compile-fail optional_test_fail1.cpp ]
[ compile-fail optional_test_fail2.cpp ]
[ compile-fail optional_test_fail3a.cpp ]
[ compile-fail optional_test_fail3b.cpp ]
[ compile-fail optional_test_ref_fail1.cpp ]
[ compile-fail optional_test_ref_fail2.cpp ]
[ compile-fail optional_test_ref_fail3.cpp ]
[ compile-fail optional_test_ref_fail4.cpp ]
[ compile-fail optional_test_inplace_fail.cpp ]
[ compile-fail optional_test_inplace_fail2.cpp ]
;
}

View File

@ -485,21 +485,12 @@ void test_throwing_assign_to_initialized( T const* )
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
-- count ;
check_is_not_pending_dtor( ARG(T) );
check_is_not_pending_copy( ARG(T) );
check_instance_count(count, ARG(T) );
check_uninitialized(opt0);
#endif
}
//