K
ken.carlino
I would need some help in figuring out this compile error. Thanks in
advance for any help.
I have a template like this:
template <class T, class T1>
class Dummy {
public:
float buildList(T& tmpAreaPerCent, const T& allAreaPerCent, int no);
};
template<class T, class T1>
float Dummy<T, T1>::buildList(T& tmpAreaPerCent, const T&
allAreaPerCent, int no) {
vector<int> allItr;
allItr.push_back(0);
int size = tmpAreaPerCent.size() - 1;
allItr.push_back(size);
sort(allItr.begin(), allItr.end());
for (int i = 0; i + 1 < allItr.size() ; i++) {
int beginIndex = allItr;
if (i != 0) beginIndex += 1;
int endIndex = allItr[i+1];
// comment calling method here
}
return 0.0;
};
This is where I create the template:
Dummy< vector<float>, float > pmh2;
float areaStdDev = pmh2.buildList(tmpAreaPerCent, allAreaPerCent,
no);
Here is the error:
.../MatcherHelper.h: In member function 'float Dummy<T,
T1>::buildList(T&, const T&, int) [with T = std::vector<float,
std::allocator<float> >, T1 = float]':
.../Row1Matcher.cpp:41: instantiated from here
.../PatternMatcherHelper.h:36: warning: comparison between signed and
unsigned integer expressions
.../Row1Matcher.cpp:41: instantiated from here
Thank you
advance for any help.
I have a template like this:
template <class T, class T1>
class Dummy {
public:
float buildList(T& tmpAreaPerCent, const T& allAreaPerCent, int no);
};
template<class T, class T1>
float Dummy<T, T1>::buildList(T& tmpAreaPerCent, const T&
allAreaPerCent, int no) {
vector<int> allItr;
allItr.push_back(0);
int size = tmpAreaPerCent.size() - 1;
allItr.push_back(size);
sort(allItr.begin(), allItr.end());
for (int i = 0; i + 1 < allItr.size() ; i++) {
int beginIndex = allItr;
if (i != 0) beginIndex += 1;
int endIndex = allItr[i+1];
// comment calling method here
}
return 0.0;
};
This is where I create the template:
Dummy< vector<float>, float > pmh2;
float areaStdDev = pmh2.buildList(tmpAreaPerCent, allAreaPerCent,
no);
Here is the error:
.../MatcherHelper.h: In member function 'float Dummy<T,
T1>::buildList(T&, const T&, int) [with T = std::vector<float,
std::allocator<float> >, T1 = float]':
.../Row1Matcher.cpp:41: instantiated from here
.../PatternMatcherHelper.h:36: warning: comparison between signed and
unsigned integer expressions
.../Row1Matcher.cpp:41: instantiated from here
Thank you