码迷,mamicode.com
首页 > 其他好文 > 详细

Using a Comparison Function for the Key Typemn

时间:2015-09-23 01:06:59      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:

(这是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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!