Posts

Showing posts from June, 2004

C++ STL set functions... and liquids that can write code

Image
Are you badass with C++ STL? Then fix this... #include <iostream> #include <map> #include <set> #include <algorithm> #include <ostream> #include <iterator> using namespace std; int main() { map<const char, int> A; A['a'] = 0; A['b'] = 5; A['c'] = 10; map<const char, int> B; B['b'] = 105; B['c'] = 110; B['d'] = 115; map<const char, int> C; set_difference(A.begin(), A.end(), B.begin(), B.end(), less<char>, inserter(C, C.begin()) ); /*cout << "Set C (difference of A and B): "; copy(C.begin(), C.end(), ostream_iterator<const char*>(cout, " ")); cout << endl;*/ } ================= <aeacides> lol <aeacides> fulld: you reversed the order of the comparison functor with the insert iterator <aeacides> set_difference(A.begin(), A.end(), B.begin(), B.end(), inserter(C, C.begin()), ltpairchar());

Bad phone sex (that used to be good) MOVED

THIS POST MOVED TO MY NEW BLOG AT https://blog.phor.net/2004/06/06/Bad-phone-sex-(that-used-to-be-good).html

The special ingredient for growing young trees MOVED

THIS POST MOVED TO MY NEW BLOG AT https://blog.phor.net/2004/06/04/The-special-ingredient-for-growing-young-trees.html

10 weird things you can do on a couch MOVED

THIS POST MOVED TO MY NEW BLOG AT https://blog.phor.net/2004/06/04/10-weird-things-you-can-do-on-a-couch.html