could you tell me why this code doesn't compile?
template <typename T, T minAge, T maxAge, bool isarmed,
typename = std::enable_if_t<std::is_arithmetic<T>::value>>
class Citizen {
public:
Citizen(T health, T age);
Citizen(T health, T age, T attackPower);
T getHealth() const { return _health; };
T getAge() const { return _age; };
T getAttackPower();
void takeDamage(T damage);
private:
T _health;
T _age;
T _attackPower;
};
template <typename T, T minAge, T maxAge, bool isarmed>
Citizen<T, minAge, maxAge, isarmed>::Citizen(T health, T age):
_health (health),
_age (age)
{
static_assert(minAge <= maxAge, "Wrong age");
assert(minAge <= this->_age && this->_age <= maxAge);
}
What am I missing?
error: invalid use of incomplete type ‘class Citizen<T, minAge, maxAge, isarmed>’