Boost logo

Boost-Commit :

From: pdimov_at_[hidden]
Date: 2008-02-19 09:01:13


Author: pdimov
Date: 2008-02-19 09:01:13 EST (Tue, 19 Feb 2008)
New Revision: 43317
URL: http://svn.boost.org/trac/boost/changeset/43317

Log:
Fixes #1444.
Added:
   trunk/libs/smart_ptr/test/scoped_array_eq_fail.cpp (contents, props changed)
   trunk/libs/smart_ptr/test/scoped_ptr_eq_fail.cpp (contents, props changed)
Text files modified:
   trunk/boost/scoped_array.hpp | 3 +++
   trunk/boost/scoped_ptr.hpp | 3 +++
   trunk/libs/smart_ptr/test/Jamfile.v2 | 2 ++
   3 files changed, 8 insertions(+), 0 deletions(-)

Modified: trunk/boost/scoped_array.hpp
==============================================================================
--- trunk/boost/scoped_array.hpp (original)
+++ trunk/boost/scoped_array.hpp 2008-02-19 09:01:13 EST (Tue, 19 Feb 2008)
@@ -46,6 +46,9 @@
 
     typedef scoped_array<T> this_type;
 
+ void operator==( scoped_array const& ) const;
+ void operator!=( scoped_array const& ) const;
+
 public:
 
     typedef T element_type;

Modified: trunk/boost/scoped_ptr.hpp
==============================================================================
--- trunk/boost/scoped_ptr.hpp (original)
+++ trunk/boost/scoped_ptr.hpp 2008-02-19 09:01:13 EST (Tue, 19 Feb 2008)
@@ -47,6 +47,9 @@
 
     typedef scoped_ptr<T> this_type;
 
+ void operator==( scoped_ptr const& ) const;
+ void operator!=( scoped_ptr const& ) const;
+
 public:
 
     typedef T element_type;

Modified: trunk/libs/smart_ptr/test/Jamfile.v2
==============================================================================
--- trunk/libs/smart_ptr/test/Jamfile.v2 (original)
+++ trunk/libs/smart_ptr/test/Jamfile.v2 2008-02-19 09:01:13 EST (Tue, 19 Feb 2008)
@@ -33,5 +33,7 @@
           [ run shared_ptr_move_test.cpp ]
           [ compile-fail shared_ptr_pv_fail.cpp ]
           [ run sp_unary_addr_test.cpp ]
+ [ compile-fail scoped_ptr_eq_fail.cpp ]
+ [ compile-fail scoped_array_eq_fail.cpp ]
         ;
 }

Added: trunk/libs/smart_ptr/test/scoped_array_eq_fail.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/smart_ptr/test/scoped_array_eq_fail.cpp 2008-02-19 09:01:13 EST (Tue, 19 Feb 2008)
@@ -0,0 +1,27 @@
+#include <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+//
+// scoped_array_eq_fail.cpp - a negative test for "p == q"
+//
+// Copyright (c) 2008 Peter Dimov
+//
+// 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)
+//
+
+#include <boost/scoped_array.hpp>
+
+int main()
+{
+ boost::scoped_array<int> p, q;
+ p == q; // must fail
+ return 0;
+}

Added: trunk/libs/smart_ptr/test/scoped_ptr_eq_fail.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/smart_ptr/test/scoped_ptr_eq_fail.cpp 2008-02-19 09:01:13 EST (Tue, 19 Feb 2008)
@@ -0,0 +1,27 @@
+#include <boost/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(disable: 4786) // identifier truncated in debug info
+#pragma warning(disable: 4710) // function not inlined
+#pragma warning(disable: 4711) // function selected for automatic inline expansion
+#pragma warning(disable: 4514) // unreferenced inline removed
+#endif
+
+//
+// scoped_ptr_eq_fail.cpp - a negative test for "p == q"
+//
+// Copyright (c) 2008 Peter Dimov
+//
+// 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)
+//
+
+#include <boost/scoped_ptr.hpp>
+
+int main()
+{
+ boost::scoped_ptr<int> p, q;
+ p == q; // must fail
+ return 0;
+}


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk