|
|
|
|
|
|
|
|
|
|
|
Re: How to link a static library in C++? [message #1717065 is a reply to message #1717054] |
Wed, 09 December 2015 13:49   |
Eclipse User |
|
|
|
Looks like it's a template function. You have to instantiate these somewhere.
Here's an example where I've instantiated Which<T> for STRING, int, UINT, float and double:
template<class T>
int Which(T val, const std::vector<T> & list);
template<class T>
int Which(const T nam, const std::vector<T> & list) {
for (UINT i=0; i<list.size(); i++) {
if (nam == list[i]) return i;
}
return -1;
}
template int Which(STRING, const std::vector<STRING> &);
template int Which(int, const std::vector<int> &);
template int Which(UINT, const std::vector<UINT> &);
template int Which(float, const std::vector<float> &);
template int Which(double, const std::vector<double> &);
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05161 seconds