I have a class with a member variable of another class:
class MeasurementUnit {
private:
MeasurementMultiplier _multiplier;
Actually I would not need a default constructor for MeasurementMultiplier
, because actually I will initialize with parameters MeasurementMultiplier(a,b,c)
, and I would - but can't directly:
C2864: 'MeasurementUnit::_multiplier' :
only static const integral data members can be initialized within a class
So I need the default constructor, without it does not compile error: C2512: 'MeasurementUnit' : no appropriate default constructor available
Can I avoid needing the default constructor?