g++ doesn't provide numeric_limits<T>

This commit is contained in:
beard%netscape.com 2000-03-09 01:35:53 +00:00
Родитель 5d04d65d6c
Коммит 41c89d932b
2 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -380,7 +380,12 @@ namespace JavaScript {
static void construct(pointer p, const T &val) {new(p) T(val);}
static void destroy(pointer p) {p->~T();}
#ifdef __GNUC__
// why doesn't g++ support numeric_limits<T>?
static size_type max_size() {return size_type(-1) / sizeof(T);}
#else
static size_type max_size() {return std::numeric_limits<size_type>::max() / sizeof(T);}
#endif
template<class U> struct rebind {typedef ArenaAllocator<U> other;};
};

Просмотреть файл

@ -380,7 +380,12 @@ namespace JavaScript {
static void construct(pointer p, const T &val) {new(p) T(val);}
static void destroy(pointer p) {p->~T();}
#ifdef __GNUC__
// why doesn't g++ support numeric_limits<T>?
static size_type max_size() {return size_type(-1) / sizeof(T);}
#else
static size_type max_size() {return std::numeric_limits<size_type>::max() / sizeof(T);}
#endif
template<class U> struct rebind {typedef ArenaAllocator<U> other;};
};