正在加载图片...
Design a generic algorithm(cont.) u Function Objects Adaptor- Brings more flexibility a Binder adaptor- bind the parameter of function object to certain value, thus transform the binary function object to unary function object bindlst(less<int>&, 10) bind2nd (less<int>&, 10) Negator adaptor- negate the return value of function object noti( bind2nd (less<int>, 10))-unary not2 (less<int>&)-binary C++11?Design a generic algorithm (cont.) ◼ Function Objects Adaptor – Brings more flexibility ◼ Binder adaptor – bind the parameter of function object to certain value, thus transform the binary function object to unary function object ◼ bind1st(less<int>&, 10) ◼ bind2nd(less<int>&, 10) ◼ Negator adaptor – negate the return value of function object ◼ not1( bind2nd(less<int>&, 10) ) – unary ◼ not2(less<int>&) – binary C++ 11?
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有