Change that hopefully will fix compile issues with cSTLAllocator on Mac OS X

This commit is contained in:
Joshua Jones 2010-03-13 22:51:26 +00:00
parent 849ba95609
commit 3bae1bc4db
1 changed files with 19 additions and 23 deletions

View File

@ -6,33 +6,29 @@
namespace cAudio
{
template <typename T> class cSTLAllocator;
template<typename T>
struct cSTLAllocatorBase
{ // base class for generic allocators
typedef T value_type;
};
// specialize for void:
template <> class cSTLAllocator<void>
{
public:
typedef void* pointer;
typedef const void* const_pointer;
// reference to void members are impossible.
typedef void value_type;
template <class U>
struct rebind
{
typedef cSTLAllocator<U> other;
};
};
template<typename T>
struct cSTLAllocatorBase<const T>
{ // base class for generic allocators for const T
typedef T value_type;
};
template <typename T> class cSTLAllocator
template <typename T> class cSTLAllocator : public cSTLAllocatorBase<T>
{
public:
typedef T value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef cSTLAllocatorBase<T> Base;
typedef typename Base::value_type value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
template<typename U>
struct rebind