Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-11-04 11:56:29

1) I'm not going to complain about fixing this - thanks
2) This code addresses the issue that (last time I checked)
boost/type_traits/is_abstract.hpp does not work on most compilers. The
intention of this code is to use the boost one where it is known to work and
to use one that returns false if is_abstract is not supported on the
platform. I believe this code supports this intention. There might be a
better way to do this. I don't know if there is a boost macro which does
the job - maybe BOOST_NO_SFNAE. Anyone is free to weigh in on this.

Robert Ramey

"Joaquín Mª López Muñoz" <joaquin_at_[hidden]> wrote in message
In MSVC 6.0, the following snippet fails:

#include <boost/archive/text_iarchive.hpp>
#include <boost/tuple/tuple.hpp>

int main()
  return 0;

complaining about is_abstract being already defined. The problem
lies in the following lines inside boost/serialization/is_abstract.hpp:

#if defined(__GNUC__) && (34 <= _GNUC__ * 10 + __GNU_MINOR) \
    || defined(__MSVC_VER) && (1310 <= __MSVC_VER) \
    || defined(__EDG_VERSION__) \
    #include <boost/type_traits/is_abstract.hpp>
// default to false if not supported
    namespace boost {
    template<class T>
    struct is_abstract {
        typedef mpl::bool_<false> type;
        BOOST_STATIC_CONSTANT(bool, value = is_abstract::type::value);
    } // namespace boost

The code is *incorrectly* using __MSVC_VER where it should use
_MSVC_VER (just one leading underscore). Thus boost::is_abstract is
twice, as boost/type_traits.hpp is implicitly included by

If nobody complains, I can fix this and commit it to the release and
main branch.
What worries me, though, is that the code above seems flawed to me
(apart from the minor typo). What happens if the compiler is not one of
taken care of explicitly in boost/serialization/is_abstract.hpp? Could
please test the first snippet in some compiler other than MSVC, ICC for
GCC or an EDG-based compiler? My thesis is that it will fail.

Thank you,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at