Ay Folks,
I am currently facing an issue where I have a templated class that has a templated friend function and said friend function's symbol cannot be resolved.
The class declaration together with the friend declaration looks like this:
namespace wgen {
template<typename T>
class Tensor : ... {
...
public:
template<typename U>
friend bool have_same_rank(const Tensor<U> &a, const Tensor<U> &b) {
...
}
};
Here is a snippet of the file in which i would like to access have_same_rank:
namespace wgen {
namespace op {
template<typename T>
const Operator<T> add = [](std::vector<Tensor<T> > params) -> std::vector<Tensor<T> > {
auto param1 = params[0];
auto param2 = params[1];
...
has_same_rank(param1, param2);
...
};
};
}
The tooling (include paths etc.) is setup right, as this file (which clearly uses Tensor) compiles when I comment out the problematic line.
So I dont think there is something wrong with my general setup.
Does anybody see anything obvious wrong with the way I am using templates, namespaces or friend functions?
If more Information is provided I can easily share.
Thanks for reading and thank you for your help in advance! (:
