or I could put it in a class "Statistics".
Anyway:
- could anyone get me an idea of how decouple these two class?
- putting it around, I don't know how template it:
template<class T>
T Max(T& t) {
return (*std::max_element( t.begin(), t.end(), Feature::less_than ));
//this will return a Value object; but how template the value of return to be a double???
}
//main.cpp
vector<Value> _values;
double maxValue = Max( _values);
template<class T>
T Max(T& t) {
return (*std::max_element( t.begin(), t.end(), Feature::less_than ));
//this will return a Value object; but how template the value of return to be a double???
}
//main.cpp
vector<Value> _values;
double maxValue = Max( _values);
To copy to clipboard, switch view to plain text mode
Bookmarks