allocator_utilites: problems with VC6

Hi, I'm trying to use allocator_utilities with VC6 in the following manner: template<typename Alloc> struct bzip2_allocator_traits { typedef typename boost::detail::allocator::rebind_to< Alloc, char >::type type; }; template< typename Alloc, typename Base = // VC6 workaround: C2516 BOOST_DEDUCED_TYPENAME bzip2_allocator_traits<Alloc>::type > struct bzip2_allocator : private Base { ... }; Unfortunately, I get the error C2039: 'rebind' : is not a member of 'fake_allocator<0>' Any suggestions? Jonathan

Hi Jonathan, Jonathan Turkanis ha escrito:
Hi,
I'm trying to use allocator_utilities with VC6 in the following manner:
template<typename Alloc> struct bzip2_allocator_traits { typedef typename boost::detail::allocator::rebind_to< Alloc, char >::type type; };
template< typename Alloc, typename Base = // VC6 workaround: C2516 BOOST_DEDUCED_TYPENAME bzip2_allocator_traits<Alloc>::type > struct bzip2_allocator : private Base { ... };
Unfortunately, I get the error C2039: 'rebind' : is not a member of 'fake_allocator<0>'
Could you please post a complete snippet showing the problem? I've tried to reproduce it, but it works here (MSVC++ 6.0 sp 5). See below. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo #include <boost/detail/allocator_utilities.hpp> template<typename Alloc> struct bzip2_allocator_traits{ typedef typename boost::detail::allocator::rebind_to< Alloc, char >::type type; }; template<typename Alloc, typename Base = // VC6 workaround: C2516 BOOST_DEDUCED_TYPENAME bzip2_allocator_traits<Alloc>::type
struct bzip2_allocator : private Base { char * allocate(std::size_t n){return Base::allocate(n);} }; typedef bzip2_allocator<std::allocator<struct foo> > my_allocator; int main() { my_allocator al; char* p=al.allocate(1); return 0; }

Joaquín Mª López Muñoz wrote:
Hi Jonathan,
Jonathan Turkanis ha escrito:
Hi,
I'm trying to use allocator_utilities with VC6 in the following manner:
template<typename Alloc> struct bzip2_allocator_traits { typedef typename boost::detail::allocator::rebind_to< Alloc, char >::type type; };
template< typename Alloc, typename Base = // VC6 workaround: C2516 BOOST_DEDUCED_TYPENAME bzip2_allocator_traits<Alloc>::type > struct bzip2_allocator : private Base { ... };
Unfortunately, I get the error C2039: 'rebind' : is not a member of 'fake_allocator<0>'
Could you please post a complete snippet showing the problem? I've tried to reproduce it, but it works here (MSVC++ 6.0 sp 5). See below.
Okay, I should have checked this. It may be difficult to find a minimal case that fails, but I'll work on it. Thanks, Jonathan
participants (2)
-
Joaquín Mª López Muñoz
-
Jonathan Turkanis