Opened 6 years ago

Closed 6 years ago

#12256 closed Bugs (fixed)

boost::container::set<std::pair<int,int>>::insert cause compilation error in debug configuration in Visual Studio 2012

Reported by: anonymous Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: container
Version: Boost 1.61.0 Severity: Showstopper
Keywords: Cc:

Description

Here is the example code

	boost::container::set<std::pair<int,int>> s;
	std::pair<int,int> p(0, 0);
	s.insert(p);

It outputs a several pages long template error starting as

1>...........\boost_1_61_0\boost/intrusive/detail/tree_value_compare.hpp(74): error C2664: 'const std::pair<_Ty1,_Ty2> &boost::move_detail::identity<T>::operator ()(const std::pair<_Ty1,_Ty2> &)' : cannot convert parameter 1 from 'const boost::container::container_detail::pair<T1,T2>' to 'const std::pair<_Ty1,_Ty2> &'
1>          with
1>          [
1>              _Ty1=int,
1>              _Ty2=int,
1>              T=std::pair<int,int>
1>          ]
1>          and
1>          [
1>              T1=int,
1>              T2=int
1>          ]
1>          and
1>          [
1>              _Ty1=int,
1>              _Ty2=int
1>          ]
1>          Reason: cannot convert from 'const boost::container::container_detail::pair<T1,T2>' to 'const std::pair<_Ty1,_Ty2>'
................................

Same code compiles correctly in release configuration. And it compiles correctly in boost 1.59 in all configurations.

Marking it as Showstopper as it breaks a lot of our code.

To reproduce - create a new VS2012 project with default settings. I didn't test it on other versions of Visual Studio.

Attachments (1)

boost_1.61.0_bug_1.7z (5.0 KB ) - added by anonymous 6 years ago.
VS2012 project to reproduce error

Download all attachments as: .zip

Change History (2)

by anonymous, 6 years ago

Attachment: boost_1.61.0_bug_1.7z added

VS2012 project to reproduce error

comment:1 by Ion Gaztañaga, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.