Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
upper_bound With binary_function Visual Studio 2008 Bug?
#include <algorithm> #include <functional> #include <iostream> #include <vector> using namespace std; struct Foo { int a; char b; }; struct comp : binary_function<const double, const Foo&, bool> { bool operator () (const double lhs, const Foo& rhs) { return lhs < rhs.a; } }; int main() { vector<Foo> test; for(int i = 0; i < 5; ++i) { Foo foo = { i + 1, 'a' + i }; test.push_back(foo); } cout << upper_bound(test.begin(), test.end(), 2, comp())->b << endl; }
run
|
edit
|
history
|
help
0
1
jkljklj
Matrix_1
Copy_and_base
enable_if::type
calling convention is part of type(?)
c++ pure apstraction
VC++ fail
imdying
#7