C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A Proposal to Add a New Multiset container Method to the Standard Library Technical Report

From: Bo Persson <bo_at_[hidden]>
Date: Tue, 11 Feb 2025 19:06:57 +0100
On tis 2025-02-11 at 09:29, Александр Поваляев via Std-Proposals wrote:
> A Proposal to Add a New Multiset container Method to the Standard
> Library Technical Report
>

> C++ Containers library std::multiset
>
> (1) size_type reduce( const Key& key );
>
> (2)
> template< class K >
> size_type reduce( K&& x );
>
> (3) size_type reduce( const Key& key, size_type count );
>
> (4)
> template< class K >
> size_type reduce( K&& x, size_type count );
>
> This method acts in right the opposite way to how method 'insert' does.
> Method 'reduce' decreases the number of std::multiset elements with
> the same key value. And while being supplied within the second argument
> 'size_type count', method 'reduce' decreases the number of std::multiset
> elements with the same key value but several times.
>

How do we know if the function is to remove the oldest or the newest
inserts? Or some in the middle?

Received on 2025-02-11 18:06:53