class template specialization
<vector>
std::hash<vector<bool>>
template <class T> struct hash; // unspecialized
template <class Alloc> struct hash <vector<bool,Alloc>>; // vector<bool>
Hash for vector
Unary function object class that defines thehashspecialization forvector<bool>.
为散列的vector<bool>特例化的一元函数对象。
The functional call returns a hash value based on the entire vector: A hash value is a value that depends solely on its argument, returning always the same value for the same argument (for a given program execution). The value returned
shall have a small likelihood of being the same as the one returned for a different argument (with chances of collision approaching1/numeric_limits<size_t>::max).
该函数根据整个vector返回一个hash值。一个hash值是根据其参数得到的唯一(独一无二)的值,一般相同的参数总会返回相同的值,该返回值应该有很小的可能和另一个不同参数返回的值相同(因为碰撞带来的改变)。
This allows the use ofvector<bool>objects as keys forunordered containers(likeunordered_setorunordered_map).
使用vector<bool>作为无序容器(unordered_set或者unordered_map)的健应该是被允许的。
Seehashfor additional information.
Member functions
operator()
Returns a hash value for its argument, as a value of typesize_t.
size_tis an unsigned integral type.
根据参数返回一个hash值。
这一篇想不到合适的例子,就不写例子了。(其实是写不出来0.0)
//翻译的不好的地方请多多指导,可以在下面留言或者点击左上方邮件地址给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。
转载请注明出处:http://blog.csdn.net/qq844352155
2014-8-20
于GDUT
分享到:
相关推荐
帮助新学习STL的童鞋们了解容器
在C++标准中,STL被组织为下面的几个头文件:<string>、<vector>、<list>、<deque>、<algorithm>、<iterator>、<set>、<map>、<memory>、<numeric>、<queue>、<functional>、<stack>和<utility>。文件中主要介绍了...
在C++标准中,STL被组织为下面的几个头文件:<string>、<vector>、<list>、<deque>、<algorithm>、<iterator>、<set>、<map>、<memory>、<numeric>、<queue>、<functional>、<stack>和<utility>。文件中主要介绍了...
在C++标准中,STL被组织为下面的几个头文件:<string>、<vector>、<list>、<deque>、<algorithm>、<iterator>、<set>、<map>、<memory>、<numeric>、<queue>、<functional>、<stack>和<utility>。文件中主要介绍了...
Defined Generic Functions<br/><br/>5.8 Functions as Algorithm Arguments<br/><br/>5.9 Function Objects<br/><br/>5.10 Container Elements<br/><br/>5.11 Errors and Exceptions Inside the STL<br/><br/>5.12 ...
</tr><br> </c:forEach><br> </table><br> <p><br> <li>循环控制标签:c:foreach</li><br><br> <table border="1"><br> <tr><br> <td>姓名</td><br> <td>年龄</td><br> <td>所属组</td><br> </tr><br> <c:forEach var...
STL的代码从广义上讲分为三类...在C++标准中,STL被组织为下面的13个头文件:<algorithm>、<deque>、<functional>、<iterator>、<vector>、<list>、<map>、 <memory>、<numeric>、<queue>、<set>、<stack>和<utility>。
STL(Standard Template ...在C++标准中,STL被组织为下面的13个头文 件:<algorithm>、<deque>、<functional>、<iterator>、<vector>、<list>、<map>、<memory>、<numeric>、<queue>、<set>、<stack> 和<utility>。
对STL容器线程安全性的期待现实一些<br>vector和string<br>条款13:尽量使用vector和string来代替动态分配的数组<br>条款14:使用reserve来避免不必要的重新分配<br>条款15:小心string实现的多样性<br>条款16:如何...
STL(Standard Template ...在C++标准中,STL被组织为下面的13个头文件:<algorithm>、<deque>、<functional>、<iterator>、<vector>、<list>、<map>、<memory>、<numeric>、<queue>、<set>、<stack>和<utility>。
<br><br>CIVStringSet_Demo.zip<br>CIVStringSet_Source.zip<br><br> 基于MFC和STL平台的字符串类,可以实现在快速字符串搜索。<br><br>enum_display_modes_demo.zip<br>enum_display_modes_src.zip<br><br> 列出...
mfciterator.zip<br>STL Iterators and the MFC (29KB)<END><br>66,atldatetime.zip<br>An ATL replacement for COleDateTime (7KB)<END><br>67,excoll.zip<br>Enhanced collection template classes: CArrayEx, ...
72.zip<br>Extension to the STL find_if and for_each<br>扩充STL库(5KB)<END><br>73,73.zip<br>Change from child window to popup window (and back) <br>将一个子窗口改成弹出式窗口(5KB)<END><br>74,74.zip<br>...
olefile.zip<br>COleFileManager - encapsulates the ugly details of implementing compound file support(4KB)<END><br>63,VBCollecs.zip<br>Simple STL Collections in ATL(14KB)<END><br>64,hyperlinks.zip<br>...
faststring.zip<br>Fast and efficient CString replacement(63KB)<END><br>12,StdString.zip<br>CString like class using STL(14KB)<END><br>13,xstring.zip<br>Extended Strings(9KB)<END><br>14,dirstring_src....
#include <vector> using namespace std; struct student { int id; string name; float height; }; int main(int argc, char* argv[]) { vector<student> onit; cout<<"请输入相关学生数据:"<<endl; ...
1,01.zip<br>Dialogs in DLL<br>在DLL中实现对话框(5KB)<END><br>2,02.zip<br>Export dialogs in MFC Extension DLLs<br>在MFC扩充DLL中输出对话框(12KB)<END><br>3,03.zip<br>Remapping resource script ID's<br>...
使用STL中的VECTOR LIST 容器实现学生管理系统,代码实现增删差改
通用工具<br>5.Standard Template Library(STL,标准模板库)<br>6.STL容器(STL Container)<br>7.STL 迭代器(STL Iterators)<br>8.STL 仿函数(functors)(又名函数对象,function objects)<br>9.STL算法...