Hi Thomas,
On Tue, Nov 1, 2011 at 11:24 PM, Sunil Thomas wrote:
The condensed code that generates the error in the last e-mail is as
follows:
<snip code>
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?
Your code (with fairly simple modifications) worked fine for me in
VC10 and g++4.X:
#include
//Added typedef and 'class' keyword below.
typedef int some_type;
template<typename T = some_type, std::size_t N=3> class my_class {
public:
my_class(const T& i0) {
BOOST_STATIC_ASSERT(N==1);
m_data[0]=i0;
}
private:
T m_data[N];
};
I suspect the error you're seeing might depend on how you instantiate
my_class -- as Steven said, more context is necessary. If you can
post a compilable example that exhibits the problem our advice will
likely be more helpful.
Nate