当前位置:   article > 正文

stl中的运算子_stl_list.h

stl_list.h
今天终于明白了下面这些的区别:

Adaptor and conversion functions

Negators
Parameter binders
Conversors
这几个是function template,而剩下的都是class template。并且这些function template的实现里面用到了其他的class template的定义。


header

<functional>

Function objects
Function objects  are objects specifically designed to be used with a syntax similar to that of functions. In C++, this is achieved by defining member function  operator()  in their class, like for example:
  1. 1
  2. 2
  3. 3
  4. 4
  1. struct myclass {
  2. int operator()(int a) {return a;}
  3. } myobject;
  4. int x = myobject (0); // function-like syntax with object myobject


They are especially useful as  predicates  or  comparison functions  to be used with standard  algorithms .
The standard library provides standard definitions for several function objects and some ways to modify and adapt their behavior in header  <functional> :

Base classes :

Operator classes


Arithmetic operations :

Comparison operations :

Logical operations :

Adaptor and conversion functions

Negators
Parameter binders
Conversors

Instrumental types

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/128138
推荐阅读
相关标签
  

闽ICP备14008679号