I just want to test an inheritance pattern but it seems I lacks some understanding. I thought father class's constructor should be evoked. Some direction is apprecitated
#include <stdio.h>
#include <iostream>
#include <memory>
template<class Gender, class Race, class ChildType>
class Father
{
public:
Father() {
std::cout << "var = " << ChildType::var << std::endl;
};
};
class Male {
public:
};
class Vietnam {
public:
};
class Worker {
public:
};
class Child : public Father<Male, Vietnam, Child>
{
public:
static int var;
};
int Child::var(10);
int main() {
std::shared_ptr<Father<Male, Vietnam, Child>> child(Child());
return 1;
}