I have some code, written on Linux, that i am attempting to compile in Windows, visual studio 2015.
In one of the Header files:
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <Eigen/StdVector>
#include "transformable_vector.h"
namespace nicp {
template <int wCoordinate_>
class HomogeneousVector4f : public Eigen::Vector4f {
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
static const float wCoordinate = wCoordinate_;
}
the lines:
template <int wCoordinate_>
class HomogeneousVector4f : public Eigen::Vector4f {
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW;
static const float wCoordinate = wCoordinate_;
are giving me this error:
Error C2864 'nicp::HomogeneousVector4f<0>::wCoordinate': a static data member with an in-class initializer must have non-volatile const integral type
I have tried removing the const
, and replacing it with constexpr
, but to the same result.
I have tried:
const float HomogeneousVector4f<wCoordinate_>::wCoordinate = wCoordinate_;
as well as:
static constexpr float wCoordinate () { return wCoordinate_; }
and:
static float wCoordinate () { return wCoordinate_; }
EDIT: I have tried all the answers in the question marked as 'duplicate', to no avail. I believe the difference here is that this class is created with an int passed to it.
Thank you.