¡@

Home 

c++ Programming Glossary: ptr_fun

What's the best way to trim std::string

http://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-stdstring

s s.erase s.begin std find_if s.begin s.end std not1 std ptr_fun int int std isspace return s trim from end static inline std.. string s s.erase std find_if s.rbegin s.rend std not1 std ptr_fun int int std isspace .base s.end return s trim from both ends.. self explanatory and work very well. EDIT btw I have std ptr_fun in there to help disambiguate std isspace because there is actually..

Using free function as pseudo-constructors to exploit template parameter deduction

http://stackoverflow.com/questions/2466507/using-free-function-as-pseudo-constructors-to-exploit-template-parameter-deducti

also makes heavy use of this in functional bind1st not1 ptr_fun etc... I find myself using this quite often so I was just wondering..

Determining if an unordered vector<T> has all unique elements

http://stackoverflow.com/questions/2769174/determining-if-an-unordered-vectort-has-all-unique-elements

i 0 i x.size i vp.push_back x i sort vp.begin vp.end ptr_fun dereference_less T O N log N return adjacent_find vp.begin vp.end.. T O N log N return adjacent_find vp.begin vp.end not2 ptr_fun dereference_less T opposite functor vp.end if no adjacent pair..

make shared_ptr not use delete

http://stackoverflow.com/questions/441306/make-shared-ptr-not-use-delete