I want to make a template class on my main.cpp then process it on another class which is from another header/cpp
Heres my code:
Main.cpp
#include <iostream>
#include "test.h"
template<typename B>
class foo{
};
int main() {
return 0;
}
test.h
namespace sn{
class A{
public:
void getint(foo<int> asd); //error because it doesn't know foo
};
}
test.cpp
#include<iostream>
#include "test.h"
namespace sn{
void A::getint(foo<int> asd){ //error because it doesn't know foo
}
}
So how can i pass an instance of a template class from or introduce "foo" from main.cpp? do i have to change my design?