Boost logo

Boost Users :

From: Wayne Hartell (whar_at_[hidden])
Date: 2002-04-11 19:37:37


Hello Boost Users,

 

I am a newbie to the Boost Graph library and am trying to come up to
speed with the use of the library as quickly as I can. Last week I
thought that one of the best ways to do this would be to work through
some of the example code in the Boost User Guide and Reference Manual
but I was disappointed to find out that the moment I included some boost
header files in my VC++ .Net project that I ran into a C1001 FATAL
COMPILER ERROR. This problem doesn't occur in VC6 nor does it occur in
the Borland 5.5 C++ compiler, however, my current project dictates that
I use the VC++ .Net compiler.

 

Before jumping on to this list with a posting I searched the archive and
noticed that a previous posting had been lodged with the same compiler
error.

 

To cut a long story short I have been in touch with Microsoft Technical
support (who were extremely helpful) and they have confirmed my issue
(and that of the previous posting) to be a bug in the VC++ .Net
compiler. Microsoft also gave me a work around for the problem so the
main purpose of this posting is to make public the work around in order
to use the BGL with the VC++ .Net compiler.

 

As I am new to the BGL if anyone has any comments on the validity of the
work around provided by Microsoft I would be grateful to hear them. I
have tried compiling the code and it now compiles, however, as I am new
to the library I am not yet in a position where I have tried out the
library in a project to verify that it besides compiling correctly, that
it also works correctly ;0)

 

Here's the work around:

 

composite_traits.hpp

 

template <typename T> // line 149

struct is_array

{

private:

      static T t;

public:

 

#if _MSC_VER == 1300 // VC.Net

      static const bool value;

#else

 

      // This is the original code block that causes the compiler error

      BOOST_STATIC_CONSTANT(bool, value =

            (::boost::type_traits::ice_and<

            (1 == sizeof(detail::is_array_helper(&t, t))),

            ::boost::type_traits::ice_not<

 
::boost::detail::is_reference_or_const_volatile<T>::value>::value,

            ::boost::type_traits::ice_not<

            (1 == sizeof(detail::is_function_tester(t)))>::value

>::value));

 

#endif

};

 

#if _MSC_VER == 1300 // VC.Net

 

      template <typename T>

      const bool is_array<T>::value =

            (::boost::type_traits::ice_and<

            (1 == sizeof(detail::is_array_helper(&t, t))),

            ::boost::type_traits::ice_not<

 
::boost::detail::is_reference_or_const_volatile<T>::value>::value,

            ::boost::type_traits::ice_not<

            (1 == sizeof(detail::is_function_tester(t)))>::value

>::value));

 

#endif

 

Kind Regards,

Wayne Hartell

[Non-text portions of this message have been removed]


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net