C ++ cannot call a method (with a template) from a template method

I have the following method in a header file called filter.h:

namespace std{

//some code

template <class T, class S, class BorderMethod>
tImage<T> binomial(const tImage<T> &in, const size_t k = 3) {
   //do some computations

  tImage<T> img = in.convolve<T, BorderMethod>(in, kernel);
  return img;
}
}

The first thing I noticed: the definition of this method occurs in the header file. Is this a standard procedure?

Now the actual problem: the method call convolvewill not work, although it indoes have such a method. Here is the definition of the method convolvein the class tImage<T>:

tImage<T> convolve(const gravis::tImage<T>& image, const gravis::tArray<typename tImageTraits<T>::Float_t>& kernel);

How do I call this function?

+5
source share
2 answers

The first thing I noticed: the definition of this method occurs in the header file. Is this a standard procedure?

. . .cpp, , , , undefined. . fooobar.com/questions/1162/....

convolve , .

convolve() - const member, const. , .


, JBentley , std. 17.6.4.2.1/1 ++ 11:

++ undefined, std std, . [...]

+6

, undefined, std.

.

+2

All Articles