[type_traits][V1.41] is_base_of<void, void> gives different results for gcc and vc

Hey, I just realized that is_base_of<void, void> gives different (inconsistent) results at least for gcc 4.3.2 (which evaluates this to false) and vc2005sp1 (evaluates to true, as earlier versions of boost did consistently, btw). This is truly a border case, but should expose consistent behavior anyways. Regards Hartmut ------------------- Meet me at BoostCon http://boostcon.com

I just realized that is_base_of<void, void> gives different (inconsistent) results at least for gcc 4.3.2 (which evaluates this to false) and vc2005sp1 (evaluates to true, as earlier versions of boost did consistently, btw). This is truly a border case, but should expose consistent behavior anyways.
Hmm.. will investigate. This should have been changed to C++0x behavior and return false throughout... John.

John Maddock wrote:
I just realized that is_base_of<void, void> gives different (inconsistent) results at least for gcc 4.3.2 (which evaluates this to false) and vc2005sp1 (evaluates to true, as earlier versions of boost did consistently, btw). This is truly a border case, but should expose consistent behavior anyways.
Hmm.. will investigate.
This should have been changed to C++0x behavior and return false throughout... John.
I suppose it may be related to differences in traits definitions between TR1 and C++0x. Similar issue is with is_pod and others. Here is my post about it to libstdc++ "std::is_pod vs std::tr1::is_pod and void type" http://gcc.gnu.org/ml/libstdc++/2009-11/msg00041.html Best regards, -- Mateusz Loskot, http://mateusz.loskot.net

I just realized that is_base_of<void, void> gives different (inconsistent) results at least for gcc 4.3.2 (which evaluates this to false) and vc2005sp1 (evaluates to true, as earlier versions of boost did consistently, btw). This is truly a border case, but should expose consistent behavior anyways.
Hmm.. will investigate.
Do you have a test case for this - I added an explicit test case for is_base_of<void, void> to the type_traits tests, and they're passing for me with both msvc-8/9 and gcc-4.x. Thanks, John.

I just realized that is_base_of<void, void> gives different (inconsistent) results at least for gcc 4.3.2 (which evaluates this to false) and vc2005sp1 (evaluates to true, as earlier versions of boost did consistently, btw). This is truly a border case, but should expose consistent behavior anyways.
Hmm.. will investigate.
Do you have a test case for this - I added an explicit test case for is_base_of<void, void> to the type_traits tests, and they're passing for me with both msvc-8/9 and gcc-4.x.
I just realized that I was using tr1::is_base_of for VC and boost::is_base_of for gcc, so this is probably expected. It's still annoying to get differences, but alas, that's not the problem of the implementation... Thanks and sorry for the noise! Regards Hartmut ------------------- Meet me at BoostCon http://boostcon.com

I just realized that I was using tr1::is_base_of for VC and boost::is_base_of for gcc, so this is probably expected.
Nod, the TR1 version freezes the TR1 behavior, where as the Boost version is tracking past that to C++0x.
It's still annoying to get differences, but alas, that's not the problem of the implementation...
Thanks and sorry for the noise!
No problem, John.
participants (3)
-
Hartmut Kaiser
-
John Maddock
-
Mateusz Loskot