Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-12-11 19:10:54


Joaquín Mª López Muñoz wrote:
> Hi Jonathan, some quick observations:

> * In boost/iostreams/detail/buffer.hpp, you can take advantage
> of boost/detail/allocator_utilities.hpp to do your allocator rebinding
> for both compliant and defective compilers. So, instead of
>
> #ifndef BOOST_NO_MEMBER_TEMPLATE
> typedef typename Alloc::template rebind<Ch>::other
> allocator_type;
> #else
> typedef mpl::if_<
> is_same<typename Alloc::value_type, Ch>,
> Alloc,
> std::allocator<Ch>
> >::type
> allocator_type;
> #endif
>
> you can write:
>
> #include <boost/detail/allocator_utilities.hpp>

> typedef typename
> boost::detail::allocator::rebind_to<Alloc,Ch>::type
> allocator_type;

Has this been tested on Borland 5.x? I get errors (see end) unless I make the
following change at line 132

  template<typename Type>
  struct result:Allocator::BOOST_NESTED_TEMPLATE rebind<Type>
  {
  };

  ==>

  template<typename Type>
  struct result:Allocator::BOOST_NESTED_TEMPLATE rebind<Type>
  {
      typedef typename Allocator::BOOST_NESTED_TEMPLATE
          rebind<Type>::other other;
  };

Best Regards,
Jonathan

-----------------------------

Error E2402 C:\Documents and
Settings\turkanis\Home\Libraries\boost-1.32.0\boost/detail/allocator_utilities.h
pp 133: Illegal base class type: formal type 'Allocator::rebind<Type>' resolves
to '_STL::allocator<char>::rebind<Type>'
Error E2404 C:\Documents and
Settings\turkanis\Home\Libraries\boost-1.32.0\boost/detail/allocator_utilities.h
pp 144: Dependent type qualifier
'boost::detail::allocator::rebinder<_STL::allocator<char> >::result<char>' has
no member type named 'other'


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