Commit 545dc5e3 by Paolo Carlini Committed by Paolo Carlini

extptr_allocator.h: Include <ext/numeric_traits.h> instead of <limits>.

2011-06-08  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/ext/extptr_allocator.h: Include <ext/numeric_traits.h>
	instead of <limits>.
	* include/bits/allocator.h: Likewise.

	* include/std/chrono (duration_values<>::min): Call lowest, not min.

From-SVN: r174805
parent d02c23af
2011-06-08 Paolo Carlini <paolo.carlini@oracle.com> 2011-06-08 Paolo Carlini <paolo.carlini@oracle.com>
* include/ext/extptr_allocator.h: Include <ext/numeric_traits.h>
instead of <limits>.
* include/bits/allocator.h: Likewise.
* include/std/chrono (duration_values<>::min): Call lowest, not min.
2011-06-08 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/allocator.h (__shrink_to_fit): Simplify. * include/bits/allocator.h (__shrink_to_fit): Simplify.
* include/bits/stl_vector.h (vector<>::shrink_to_fit): Adjust. * include/bits/stl_vector.h (vector<>::shrink_to_fit): Adjust.
* include/bits/stl_deque.h: Likewise. * include/bits/stl_deque.h: Likewise.
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#ifdef __GXX_EXPERIMENTAL_CXX0X__ #ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <bits/ptr_traits.h> #include <bits/ptr_traits.h>
#include <bits/uses_allocator.h> #include <bits/uses_allocator.h>
#include <limits> #include <ext/numeric_traits.h>
#endif #endif
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
...@@ -477,7 +477,7 @@ _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_swap, ...@@ -477,7 +477,7 @@ _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_swap,
static typename static typename
enable_if<!__maxsize_helper<_Alloc2>::value, size_type>::type enable_if<!__maxsize_helper<_Alloc2>::value, size_type>::type
_S_max_size(_Alloc2&) _S_max_size(_Alloc2&)
{ return numeric_limits<size_type>::max(); } { return __gnu_cxx::__numeric_traits<size_type>::__max; }
template<typename _Alloc2> template<typename _Alloc2>
struct __select_helper struct __select_helper
......
// <extptr_allocator.h> -*- C++ -*- // <extptr_allocator.h> -*- C++ -*-
// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. // Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define _EXTPTR_ALLOCATOR_H 1 #define _EXTPTR_ALLOCATOR_H 1
#include <memory> #include <memory>
#include <limits> #include <ext/numeric_traits.h>
#include <ext/pointer.h> #include <ext/pointer.h>
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
...@@ -98,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -98,7 +98,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ _M_real_alloc.deallocate(__p.get(), __n); } { _M_real_alloc.deallocate(__p.get(), __n); }
size_type max_size() const throw() size_type max_size() const throw()
{ return std::numeric_limits<size_type>::max() / sizeof(_Tp); } { return __numeric_traits<size_type>::__max / sizeof(_Tp); }
#ifdef __GXX_EXPERIMENTAL_CXX0X__ #ifdef __GXX_EXPERIMENTAL_CXX0X__
template<typename _Up, typename... _Args> template<typename _Up, typename... _Args>
...@@ -111,6 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -111,6 +111,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
destroy(_Up* __p) destroy(_Up* __p)
{ __p->~_Up(); } { __p->~_Up(); }
#else #else
void construct(pointer __p, const _Tp& __val) void construct(pointer __p, const _Tp& __val)
{ ::new(__p.get()) _Tp(__val); } { ::new(__p.get()) _Tp(__val); }
......
...@@ -203,7 +203,7 @@ _GLIBCXX_END_NAMESPACE_VERSION ...@@ -203,7 +203,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
static constexpr _Rep static constexpr _Rep
min() min()
{ return numeric_limits<_Rep>::min(); } { return numeric_limits<_Rep>::lowest(); }
}; };
template<typename T> template<typename T>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment