标签:
(这是C++系列随笔的第二篇,这一系列是我练习C++而查的资料)
C++ Primer 5th. Ed. pp. 425
----------------------
Using a Comparison for the Key Type
The type of the operation that a container uses to organize its elements is part of the type of that container. To specify our own operation, we musrt supply the type of that operation when we define the type of an associative container (including prioroty_queue). The operation type is specified following the element type inside the angle brackets that we use to say which type of container we are defining.
Each type inside the angle brackets is just that, a type. We supply a particular comparison operation (that must have the same type as we specified inside the angle brackets, and conversely we msut specify the type inside the angle the same type as we can supply outside) as a constructor argument when we create a container.
----------------------
C++ Primer, 5th. Ed. pp. 249
----------------------
Function Parameter Parameters
Just as with arrays, we cannot define parameters of function
Using a Comparison Function for the Key Typemn
标签:
原文地址:http://www.cnblogs.com/Patt/p/4831021.html