STL function object

xiaoxiao2021-03-14  197

"C must know" is really good. The last chapter tells the function object replaces the function pointer. Today, I have turned it, and I saw the STL function object. In fact, the truth and the last chapter are almost the same, the only difference is If you use STL function objects, you must remember that these function objects are inherited standard function objects: std :: binary_function (binary function), std :: unary_function. Still overload the Operator () operator. Such a STL function can be an inline function, and can use the standard library algorithm, or it is necessary to learn.

The following example is written according to the content on the book, and the popless is a relatively small function, and isten is simpler, that is, the ID of the judgment class is 10. Let's take a look, it is good for it.

转载请注明原文地址:https://www.9cbs.com/read-129396.html

New Post(0)