
AMDG On 11/01/2011 10:24 PM, Sunil Thomas wrote:
The condensed code that generates the error in the last e-mail is as follows:
template<typename T = some_type, std::size_t N=3> my_class { public: my_class(const T& i0) { BOOST_STATIC_ASSERT(N==1); m_data[0]=i0; } private: T m_data[N]; }
I realize that N defaults to 3 and all, but without making any sweeping changes, is there a way to force MSVC++ 2010 to just compile, considering this was compiling fine with MSVC++ 2008?
The following code compiles fine with MSVC 2010. #include <cstddef> #include <boost/static_assert.hpp> template<class T = int, std::size_t N = 3> class C { public: C() {} C(const T& i0) { BOOST_STATIC_ASSERT(N == 1); m_data[0] = i0; } private: T m_data[N]; }; int main() { C<> c; } Can you provide a minimal *complete* test case that fails? In Christ, Steven Watanabe