less - C++ Reference - CPlusPlus.com

文章推薦指數: 80 %
投票人數:10人

Binary function object class whose call returns whether the its first argument compares less than the second (as returned by operator < ). Search: Reference less classtemplate std::less templatestructless;Functionobjectclassforless-thaninequalitycomparison Binaryfunctionobjectclasswhosecallreturnswhethertheitsfirstargumentcompareslessthanthesecond(asreturnedbyoperatorstructless:binary_function{ booloperator()(constT&x,constT&y)const{returnxstructless{ booloperator()(constT&x,constT&y)const{returnx//std::cout #include//std::less #include//std::sort,std::includes intmain(){ intfoo[]={10,20,5,15,25}; intbar[]={15,10,20}; std::sort(foo,foo+5,std::less());//510152025 std::sort(bar,bar+3,std::less());//101520 if(std::includes(foo,foo+5,bar,bar+3,std::less())) std::cout<(assert.h) (ctype.h) (errno.h) (fenv.h) (float.h) (inttypes.h) (iso646.h) (limits.h) (locale.h) (math.h) (setjmp.h) (signal.h) (stdarg.h) (stdbool.h) (stddef.h) (stdint.h) (stdio.h) (stdlib.h) (string.h) (tgmath.h) (time.h) (uchar.h) (wchar.h) (wctype.h) Containers: Input/Output: Multi-threading: Other: functions: bind cref mem_fn not1 not2 ref wrapperclasses: binary_negate function reference_wrapper unary_negate operatorclasses: bit_and bit_or bit_xor divides equal_to greater greater_equal less less_equal logical_and logical_not logical_or minus modulus multiplies negate not_equal_to plus otherclasses: bad_function_call hash is_bind_expression is_placeholder namespaces: placeholders deprecated: binary_function bind1st bind2nd binder1st binder2nd const_mem_fun1_ref_t const_mem_fun1_t const_mem_fun_ref_t const_mem_fun_t mem_fun mem_fun1_ref_t mem_fun1_t mem_fun_ref mem_fun_ref_t mem_fun_t pointer_to_binary_function pointer_to_unary_function ptr_fun unary_function Homepage|Privacypolicy©cplusplus.com,2000-2022-Allrightsreserved-v3.2Spottedanerror?contactus



請為這篇文章評分?