The following code does what I want it to do on two different compilers
(g++ and Intel icc under Linux), but I'm not sure if it is undefined
and just happens to work:
class A {
public:
int i;
};
bool comp_A_i (const A &a, int i) {
return a.i < i;
}
int main( ) {
std::vector<A> v(6);
int i;
std::vector<A>::iterator pos
= lower_bound(v.begin(), v.end(), i, comp_A_i);
}
Is the function comp_A_i properly defined having two different
argument types?