Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-06-22 17:21:42


Constructs like that one can be made to work with MSVC, although
occasionally you have to break them up, e.g.:

typedef Allocator::template rebind<T> rebind;
typedef typename rebind::other t_allocator_type;

-Dave

----- Original Message -----
From: "Douglas Gregor" <gregod_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, June 22, 2001 5:54 PM
Subject: [boost] MSVC, STLport, and allocators

> Hello all,
> I've been analyzing a failure in Boost.Function with MSVC and STLport 4.0.
> It appears that, even though STLport has a conforming allocator, MSVC
won't
> allow use of it. The 'rebind' member template, which is conspicuously
absent
> from the standard library that ships with MSVC, cannot be used so far as I
> can tell. The standard usage (template parameters Allocator and T):
>
> typedef typename Allocator::template rebind<T>::other t_allocator_type;
>
> causes an internal compiler error. I was not able to find a real
workaround.
>
> It seems that only regex rebinds allocators. The method used in regex is
to
> create a new class that derives from Allocator but handles the allocations
> for the new type T. This requires Allocator to allocator chars so that the
> derived allocator can work.
>
> So now come the questions. It would appear that MSVC6sp5 cannot support
> standard allocators. Possible remedies are:
> 1) Export the regex hack so that other libraries can use it.
> 2) Define BOOST_NO_STD_ALLOCATOR for MSVC, always.
> 3) Find another magic hack
>
> Help?
>
> Confusedly-yours,
> Doug
>
> Info: http://www.boost.org Unsubscribe:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk