Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-05-10 06:29:16

> Does anyone know of any weird behavior from allocators in VC 8.0? The
> Function library uses allocators when available, but the two tests of
> allocators (allocator_test and function_test) are failing on VC 8.0 (but
> not 7.1). From the config info, I see that BOOST_HAS_PARTIAL_STD_ALLOCATOR
> is defined but BOOST_NO_STD_ALLOCATOR is not (boost::function uses the
> latter).
> The actual failure is here:
> Could someone with access to VC 8.0 (beta 2, I guess) check to see what is
> happening here?

It's the first fallout from the recent type_traits changes, but it's a bug
in the test case that's being exposed:

Boost::function doesn't allocate any storage if the function object is
stateless, and VC8 is now the first compiler to automatically detect
stateless user-defined types via is_stateless, so Boost.Function assignment
goes via:

template<typename FunctionObj>
void assign_to(FunctionObj, detail::function::stateless_function_obj_tag)

which doesn't use an allocator at all, hence the failed tests.

I think the solution is to fix the tests to use function objects that do
have state.



Boost list run by bdawes at, gregod at, cpdaniel at, john at