Modify

Opened 4 years ago

Closed 4 years ago

#9009 closed Bugs (fixed)

flat_set.insert() is ambigious

Reported by: Jon Kalb <boost@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: container
Version: Boost 1.54.0 Severity: Regression
Keywords: move Cc:

Description

Here is the code:

#include "boost/container/flat_set.hpp"

int main() {

boost::container::flat_set<int> const fs0;

boost::container::flat_set<int> fs1;

fs1.insert(fs0.begin(), fs0.end());

}

This is with C++03 not C++11.

The error is that the call to insert is ambiguous.

This is a regression. It doesn't happing in 1.49. (I think it was introduced by move support.)

I believe the issue is that if the iterators are of the same type, then the iterator pair insert is supposed to be preferred because the template that has both parameters being the same time is more specialized. But with the move semantic implementation macros, the form (const_iterator, value) is only templated on the second parameter so it isn't less specific.

Attachments (0)

Change History (2)

comment:1 Changed 4 years ago by Ion Gaztañaga

You are right. It was introduced by the move support. I think I have a fix for it.

comment:2 Changed 4 years ago by Ion Gaztañaga

Resolution: fixed
Status: newclosed

(In [85660]) Fixes #9009

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.