зеркало из https://github.com/mozilla/pjs.git
g++ doesn't provide numeric_limits<T>
This commit is contained in:
Родитель
5d04d65d6c
Коммит
41c89d932b
|
@ -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;};
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче