Original Post
The following code is giving me this error with Visual C++ 8: C3860: template argument list following class template name must list parameters in the order used in template parameter list. The problem is with initilizing the static member of VectorMembers. I need to do this slightly differently to get the compiler to do what I want, but I don't know how. Thanks for any help.
template <size_t dimensions, typename T> struct Vector
{
BOOST_STATIC_ASSERT( (dimensions >= 2) && (dimensions <= 4) );
};
class VectorMembers
{
public:
static T& Get(Vector<dimensions, T> &v, size_t i)
{
return v.*members;
}
private:
typedef T Vector<dimensions, T>::* const vec[dimensions];
static const vec members;
};
template <typename T> struct Vector<2, T>
{
T x, y;
};
template< typename T >
const typename VectorMembers<2, T>::vec VectorMembers<2, T>::members = { &Vector<2, T>::x, &Vector<2, T>::y };