Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2003-01-29 08:46:16


> Before changing the documentation please consider the following improved
> implemetation that overcomes ambiguity and access control issues of the
> current is_base_and_derived implemetation (I lately posted it to
c.l.c++.m)

That's really interesting, but I can't get to work with the compilers I have
access to (Borland/gcc), I've attached a modified version that at least
compiles with these compilers, but it doesn't produce the correct results:

Running 1 test case...
 Platform: Cygwin
 Compiler: GNU C++ version 3.2 20020927 (prerelease)
 STL : GNU libstdc++ version 20020927
 Boost : 1.30.0
is_base_and_derived_test.cpp(109): error in "is_base_and_derived": The
expression: "(::boost::is_base_and_derived<Derived,Derived>::value)" had an
invalid value (found 0, expected 1)
is_base_and_derived_test.cpp(110): error in "is_base_and_derived": The
expression: "(::boost::is_base_and_derived<Base,Base>::value)" had an
invalid value (found 0, expected 1)
is_base_and_derived_test.cpp(111): error in "is_base_and_derived": The
expression: "(::boost::is_base_and_derived<Base,Derived>::value)" had an
invalid value (found 0, expected 1)
is_base_and_derived_test.cpp(119): error in "is_base_and_derived": The
expression: "(::boost::is_base_and_derived<VB,VD>::value)" had an invalid
value (found 0, expected 1)
is_base_and_derived_test.cpp(121): error in "is_base_and_derived": The
expression: "(::boost::is_base_and_derived<test_abc1,test_abc3>::value)" had
an invalid value (found 0, expected 1)

Test suite "Type Traits" failed with:
15 assertions out of 20 passed
 5 assertions out of 20 failed

  Test case "is_base_and_derived" failed with:
  15 assertions out of 20 passed
   5 assertions out of 20 failed

Any ideas, or results from other compilers?

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk