首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::multiset::count

size_type count( const Key& key ) const;

(1)

template< class K > size_type count( const K& x ) const;

(2)

(since C++14)

返回具有比较键的元素数。等价物指向指定的参数。

1%29返回带键的元素数。key...

2%29返回与值相等的键元素数。x。此重载仅在下列情况下才参与重载解析:Compare::is_transparent是有效的,并表示类型。它们允许调用此函数,而无需构造Key...

参数

key

-

key value of the elements to count

x

-

alternative value to compare to the keys

返回值

具有比较键的元素数等价物keyx...

复杂性

容器大小的对数加上所找到的元素数的线性。

另见

find

finds element with specific key (public member function)

equal_range

returns range of elements matching a specific key (public member function)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券