Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64944 - sandbox/opaque/libs/opaque/test
From: vicente.botet_at_[hidden]
Date: 2010-08-22 05:33:55


Author: viboes
Date: 2010-08-22 05:33:54 EDT (Sun, 22 Aug 2010)
New Revision: 64944
URL: http://svn.boost.org/trac/boost/changeset/64944

Log:
Towards Opaque implementation
Text files modified:
   sandbox/opaque/libs/opaque/test/private_opaque_test.cpp | 2
   sandbox/opaque/libs/opaque/test/two_level_conversion_fails.cpp | 54 ++++++++++++++++++++++++++++++++++-----
   2 files changed, 48 insertions(+), 8 deletions(-)

Modified: sandbox/opaque/libs/opaque/test/private_opaque_test.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/private_opaque_test.cpp (original)
+++ sandbox/opaque/libs/opaque/test/private_opaque_test.cpp 2010-08-22 05:33:54 EDT (Sun, 22 Aug 2010)
@@ -27,7 +27,7 @@
     //~ a=b; // error
     a=a2; // OK
 
- unsigned i;
+ //~ unsigned i;
 
     //~ i=opaque_static_cast<unsigned>(a);
     //~ i=a; // error

Modified: sandbox/opaque/libs/opaque/test/two_level_conversion_fails.cpp
==============================================================================
--- sandbox/opaque/libs/opaque/test/two_level_conversion_fails.cpp (original)
+++ sandbox/opaque/libs/opaque/test/two_level_conversion_fails.cpp 2010-08-22 05:33:54 EDT (Sun, 22 Aug 2010)
@@ -45,6 +45,24 @@
 
 BOOST_OPAQUE_STATIC_ASSERT((
     mpl::contains<
+ energy::substituables,
+ double
+ >::value),
+ SSSSSSSSSSS,
+ (energy::substituables)
+);
+
+BOOST_OPAQUE_STATIC_ASSERT((
+ mpl::contains<
+ potential_energy::substituables,
+ energy
+ >::value),
+ SSSSSSSSSSS,
+ (potential_energy::substituables)
+);
+
+BOOST_OPAQUE_STATIC_ASSERT((
+ mpl::contains<
         potential_energy::substituables,
         mass1_leng2_per_time2
>::value),
@@ -52,18 +70,40 @@
     (potential_energy::substituables)
 );
 
+BOOST_OPAQUE_STATIC_ASSERT((
+ mpl::contains<
+ potential_energy::substituables,
+ double
+ >::value),
+ SSSSSSSSSSS,
+ (potential_energy::substituables)
+);
+
 void public_multiple_levels_fail() {
- mass1_leng2_per_time2 x;
- energy e;
- potential_energy p, q;
+ {
+ double d=1;
+ mass1_leng2_per_time2 x(d);
+ energy e(d);
+ potential_energy p(d);
 
     x = e;
     e = p;
- x = p; // error two levels
- //~ x = p + q; // error two levels
- //~ test.cpp:287: error: no match for 'operator=' in 'x = boost::operator+(const potential_energy&, const potential_energy&)(((const potential_energy&)((const potential_energy*)(& q))))'
- //~ test.cpp:270: note: candidates are: mass1_leng2_per_time2& mass1_leng2_per_time2::operator=(const mass1_leng2_per_time2&)
+ x = p; // 2 levels
+ d = p; // 3 levels
+ }
+#if 1
+ {
+ int d=1;
+ mass1_leng2_per_time2 x(d);
+ energy e(d);
+ potential_energy p(d);
 
+ x = e;
+ e = p;
+ x = p; // 2 levels
+ d = p; // 3 levels
+ }
+#endif
 }
 
 


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