1

According to this question: Separate classes into separate files in C++, we can do:

a.hpp:

class A
{
    private:
        int value;
    public:
        A(int value);
        int get_value();
};

a.cpp:

A::A(int value)
{
    this->value = value;
}

int A::get_value()
{
    return value;
}

But, I have no idea how to do something like that, when the class A is template, like:

a.hpp:

template<typename T>
class A
{
    private:
        T value;
    public:
        A(T value);
        T get_value();
};

0 Answers0