Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3076 closed Bugs (fixed)

[multi_index] assertion failure sorting an empty collection in VC10 Beta 1

Reported by: Richard Webb <richard.webb@…> Owned by: Joaquín M López Muñoz
Milestone: Boost 1.40.0 Component: multi_index
Version: Boost 1.38.0 Severity: Problem
Keywords: Cc:


The Bimap 'test_bimap_sequenced' test is failing in VC10 beta due to an assertion failure (, but the actual problem seems to be in multi_index.

When you run the sample:

using namespace boost::multi_index;

typedef multi_index_container<
> text_container;

int _tmain(int argc, _TCHAR* argv[])
	text_container tc;

	return 0;

the call to std::copy on line 190 of rnd_index_ops.hpp passes NULL as the third parameter (&*buf). The VC10 version of copy asserts if the 3rd param is NULL, causing the failure.

Change History (4)

comment:1 Changed 9 years ago by Joaquín M López Muñoz

Resolution: fixed
Status: newclosed

(In [53246]) fixed #3076

comment:2 Changed 9 years ago by Joaquín M López Muñoz

Hi Richard,

Thanks for reporting this bug. I've just commited a fix:

I'd appreciate if you can have keep an eye on this to make sure the problems in bimap eventually disappear.

There's one thing in your description of the problem that puzzles me a bit: you say that std::copy asserts because the third parameter is NULL, yet it seems to me that it's entirely ok to invoke


as long as first==last and consequently NULL is not dereferenced. Can you provide me with more info on the kind of assertion failure you're seeing? Can't it rather be the expression &*buf that is failing?

comment:3 Changed 9 years ago by Richard Webb <richard.webb@…>

In VC9, the copy code does the check

_DEBUG_RANGE(_First, _Last); if (_First != _Last)


Wheras VC10 just does

_DEBUG_RANGE(_First, _Last); _DEBUG_POINTER(_Dest);

(Where _DEBUG_POINTER gives an error if _Dest is NULL). So VC9 only complains if Dest is null and theres something to do, but VC10 gives you an error any time it's null.

comment:4 Changed 9 years ago by anonymous

I see. I'm not entirely sure the VC10 checking is conformant, so I've posted a query to comp.std.c++:

Let's see what the gurus say.

Note: See TracTickets for help on using tickets.