public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3] Avoid including the whole <limits> in a couple of places + small fix to std::duration_values
@ 2011-06-08 12:34 Paolo Carlini
  0 siblings, 0 replies; only message in thread
From: Paolo Carlini @ 2011-06-08 12:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

Hi,

tested x86_64-linux, committed.

Paolo.

///////////////////////

[-- Attachment #2: CL --]
[-- Type: text/plain, Size: 253 bytes --]

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.

[-- Attachment #3: patchlet --]
[-- Type: text/plain, Size: 2327 bytes --]

Index: include/std/chrono
===================================================================
--- include/std/chrono	(revision 174804)
+++ include/std/chrono	(working copy)
@@ -203,7 +203,7 @@
 
 	static constexpr _Rep
 	min()
-	{ return numeric_limits<_Rep>::min(); }
+	{ return numeric_limits<_Rep>::lowest(); }
       };
 
     template<typename T>
Index: include/ext/extptr_allocator.h
===================================================================
--- include/ext/extptr_allocator.h	(revision 174804)
+++ include/ext/extptr_allocator.h	(working copy)
@@ -1,6 +1,6 @@
 // <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
 // software; you can redistribute it and/or modify it under the
@@ -37,7 +37,7 @@
 #define _EXTPTR_ALLOCATOR_H 1
 
 #include <memory>
-#include <limits>
+#include <ext/numeric_traits.h>
 #include <ext/pointer.h>
 
 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
@@ -98,7 +98,7 @@
       { _M_real_alloc.deallocate(__p.get(), __n); }
 
       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__
       template<typename _Up, typename... _Args>
@@ -111,6 +111,7 @@
         destroy(_Up* __p)
         { __p->~_Up(); }
 #else
+
       void construct(pointer __p, const _Tp& __val)
       { ::new(__p.get()) _Tp(__val); }
 
Index: include/bits/allocator.h
===================================================================
--- include/bits/allocator.h	(revision 174804)
+++ include/bits/allocator.h	(working copy)
@@ -50,7 +50,7 @@
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
 #include <bits/ptr_traits.h>
 #include <bits/uses_allocator.h>
-#include <limits>
+#include <ext/numeric_traits.h>
 #endif
 
 namespace std _GLIBCXX_VISIBILITY(default)
@@ -477,7 +477,7 @@
 	static typename
        	enable_if<!__maxsize_helper<_Alloc2>::value, size_type>::type
 	_S_max_size(_Alloc2&)
-	{ return numeric_limits<size_type>::max(); }
+	{ return __gnu_cxx::__numeric_traits<size_type>::__max; }
 
       template<typename _Alloc2>
 	struct __select_helper

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-08 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08 12:34 [v3] Avoid including the whole <limits> in a couple of places + small fix to std::duration_values Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).