|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51988 - in trunk: boost/type_traits libs/type_traits/test
From: john_at_[hidden]
Date: 2009-03-26 13:57:06
Author: johnmaddock
Date: 2009-03-26 13:57:05 EDT (Thu, 26 Mar 2009)
New Revision: 51988
URL: http://svn.boost.org/trac/boost/changeset/51988
Log:
Mostly fix is_virtual_base_of on Borland.
Text files modified:
trunk/boost/type_traits/is_virtual_base_of.hpp | 6 +++---
trunk/libs/type_traits/test/is_virtual_base_of_test.cpp | 3 ++-
trunk/libs/type_traits/test/test.hpp | 4 ++--
3 files changed, 7 insertions(+), 6 deletions(-)
Modified: trunk/boost/type_traits/is_virtual_base_of.hpp
==============================================================================
--- trunk/boost/type_traits/is_virtual_base_of.hpp (original)
+++ trunk/boost/type_traits/is_virtual_base_of.hpp 2009-03-26 13:57:05 EDT (Thu, 26 Mar 2009)
@@ -36,21 +36,21 @@
template<typename Base, typename Derived>
struct is_virtual_base_of_impl<Base, Derived, mpl::true_>
{
- struct X : Derived, virtual Base
+ struct X : public virtual Derived, public virtual Base
{
X();
X(const X&);
X& operator=(const X&);
~X();
};
- struct Y : Derived
+ struct Y : public virtual Derived
{
Y();
Y(const Y&);
Y& operator=(const Y&);
~Y();
};
- BOOST_STATIC_CONSTANT(bool, value = sizeof(X)==sizeof(Y));
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(X)==sizeof(Y)));
};
template<typename Base, typename Derived>
Modified: trunk/libs/type_traits/test/is_virtual_base_of_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_virtual_base_of_test.cpp (original)
+++ trunk/libs/type_traits/test/is_virtual_base_of_test.cpp 2009-03-26 13:57:05 EDT (Thu, 26 Mar 2009)
@@ -9,7 +9,6 @@
#include "check_integral_constant.hpp"
#include <boost/type_traits/is_virtual_base_of.hpp>
-
TT_TEST_BEGIN(is_virtual_base_of)
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<Derived,Base>::value), false);
@@ -35,7 +34,9 @@
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<virtual_inherit1,Base>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<Base,virtual_inherit2>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<virtual_inherit2,Base>::value), false);
+#ifndef BOOST_BROKEN_IS_BASE_AND_DERIVED
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<Base,virtual_inherit3>::value), true);
+#endif
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<virtual_inherit3,Base>::value), false);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<boost::noncopyable,virtual_inherit4>::value), true);
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_virtual_base_of<virtual_inherit4,boost::noncopyable>::value), false);
Modified: trunk/libs/type_traits/test/test.hpp
==============================================================================
--- trunk/libs/type_traits/test/test.hpp (original)
+++ trunk/libs/type_traits/test/test.hpp 2009-03-26 13:57:05 EDT (Thu, 26 Mar 2009)
@@ -368,8 +368,8 @@
struct virtual_inherit1 : virtual Base { };
struct virtual_inherit2 : virtual_inherit1 { };
struct virtual_inherit3 : private virtual Base {};
-struct virtual_inherit4 : private virtual boost::noncopyable {};
-struct virtual_inherit5 : private virtual int_convertible {};
+struct virtual_inherit4 : virtual boost::noncopyable {};
+struct virtual_inherit5 : virtual int_convertible {};
typedef void foo0_t();
typedef void foo1_t(int);
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