allocator_selector Struct Template Reference
[Memory Library]

#include <stlsoft/memory/allocator_selector.hpp>

List of all members.


Detailed Description

template<typename T>
struct stlsoft::allocator_selector< T >

Type generator class template that selects an appropriate allocator specialisation for the given type.

It is used in several components in the STLSoft libraries, performing the function of selecting a specialisation of std::allocator for compilers/libraries where that is defined and compatible, otherwise selecting a specialisation of one of the allocator classes provided by STLSoft.

Although not likely to be necessary, it is available for use in user's class templates, as in:

template< typename T
        , typename A = typename stlsoft::allocator_selector<T>::allocator_type
        >
class my_buffer
{
public: // Member types
  typedef T   value_type;
  typedef A   allocator_type;

  . . .
};

See also:
stlsoft::auto_buffer

Public Types

typedef _some_allocator_< T > allocator_type
 The actual allocator specialisation.

Member Typedef Documentation

typedef _some_allocator_<T> allocator_type

The actual allocator specialisation.

This will be one of: stlsoft::malloc_allocator<T>, stlsoft::new_allocator<T> or stlsoft::std::allocator<T>.


The documentation for this struct was generated from the following file:

Generated on Thu Jun 10 08:58:51 2010 for STLSoft by  doxygen 1.5.6