首页 > 其他 > 详细

Using a Comparison Function for the Key Typemn

时间:2015-09-23 01:05:58      阅读:216      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!