
The following simple snippet ICEs in MSVC 6.5: #include <boost/mpl/vector_c.hpp> #include <boost/mpl/assert.hpp> template<int N> struct foo:boost::mpl::vector_c<int,N> { }; Yet, this version (where assert.hpp is included first) compiles fine: #include <boost/mpl/assert.hpp> #include <boost/mpl/vector_c.hpp> template<int N> struct foo:boost::mpl::vector_c<int,N> { }; The situation is the same if I change vector_c for list_c. With plain vectors and lists, however, everytihng's fine. ????? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Joaquín Mª López Muñoz wrote:
The following simple snippet ICEs in MSVC 6.5:
#include <boost/mpl/vector_c.hpp> #include <boost/mpl/assert.hpp>
template<int N> struct foo:boost::mpl::vector_c<int,N> { };
Yet, this version (where assert.hpp is included first) compiles fine:
#include <boost/mpl/assert.hpp> #include <boost/mpl/vector_c.hpp>
template<int N> struct foo:boost::mpl::vector_c<int,N> { };
I might know what this is, but I haven't got access to Visual C++ at the moment, so I'm not sure. Anyway, try this: #include <boost/mpl/vector_c.hpp> #include <boost/mpl/assert.hpp> class dummy { void func(); }; template<int N> struct foo:boost::mpl::vector_c<int,N> { }; Here's a simple example of code which triggers this bug: namespace y1 { struct y2 {}; } struct x1 { void x2(y1::y2); }; // This line prevents the Internal Compiler Error: // class dummy { void func(); }; template <int N> struct z {}; Daniel

Daniel James writes:
Here's a simple example of code which triggers this bug:
namespace y1 { struct y2 {}; }
struct x1 { void x2(y1::y2); };
// This line prevents the Internal Compiler Error: // class dummy { void func(); };
template <int N> struct z {};
A somewhat more convenient workaround is this: typedef int int_t; ... template <int_t N> struct z {}; -- Aleksey Gurtovoy MetaCommunications Engineering

Joaquín Mª López Muñoz writes:
The following simple snippet ICEs in MSVC 6.5:
#include <boost/mpl/vector_c.hpp> #include <boost/mpl/assert.hpp>
template<int N> struct foo:boost::mpl::vector_c<int,N> { };
Yet, this version (where assert.hpp is included first) compiles fine:
#include <boost/mpl/assert.hpp> #include <boost/mpl/vector_c.hpp>
template<int N> struct foo:boost::mpl::vector_c<int,N> { };
The situation is the same if I change vector_c for list_c. With plain vectors and lists, however, everytihng's fine. ?????
This has little to do with MPL; non-type integer template parameters are generally "unsafe" on MSVC 6.x: namespace std { template< typename Char > struct string; } void foo(std::string<char>); template< int C > struct arg; // ICE here MPL avoids the problem internally by using the following workaround: #include <boost/mpl/aux_/nttp_decl.hpp> ... template< BOOST_MPL_AUX_NTTP_DECL(int, C) > struct arg; // OK HTH, -- Aleksey Gurtovoy MetaCommunications Engineering
participants (3)
-
Aleksey Gurtovoy
-
Daniel James
-
Joaquín Mª López Muñoz