diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-17 12:18:54 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-17 12:18:54 +0000 |
| commit | 1b672f866350e3a85e6b96f83fb702a267fd8837 (patch) | |
| tree | 8f4cd303cff6ada2cf97e2e396a50200893298d3 /libstdc++-v3/include/std/limits | |
| parent | 4284910fb13d9a02893c7e97f6bd9599ec89260f (diff) | |
| download | ppe42-gcc-1b672f866350e3a85e6b96f83fb702a267fd8837.tar.gz ppe42-gcc-1b672f866350e3a85e6b96f83fb702a267fd8837.zip | |
2010-02-17 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/limits: Implement resolution of DR 559 (CD1) in
C++0x mode.
* testsuite/18_support/numeric_limits/dr559.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156830 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/limits')
| -rw-r--r-- | libstdc++-v3/include/std/limits | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/libstdc++-v3/include/std/limits b/libstdc++-v3/include/std/limits index 76a53222893..a633d78bf03 100644 --- a/libstdc++-v3/include/std/limits +++ b/libstdc++-v3/include/std/limits @@ -45,10 +45,10 @@ // // The numeric_limits<> traits document implementation-defined aspects // of fundamental arithmetic data types (integers and floating points). -// From Standard C++ point of view, there are 13 such types: +// From Standard C++ point of view, there are 14 such types: // * integers // bool (1) -// char, signed char, unsigned char (3) +// char, signed char, unsigned char, wchar_t (4) // short, unsigned short (2) // int, unsigned (2) // long, unsigned long (2) @@ -62,7 +62,7 @@ // * integer // long long, unsigned long long (2) // -// which brings us to 15 fundamental arithmetic data types in GNU C++. +// which brings us to 16 fundamental arithmetic data types in GNU C++. // // // Since a numeric_limits<> is a bit tricky to get right, we rely on @@ -302,8 +302,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std) static _Tp denorm_min() throw() { return static_cast<_Tp>(0); } }; - // Now there follow 15 explicit specializations. Yes, 15. Make sure - // you get the count right. +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template<typename _Tp> + struct numeric_limits<const _Tp> + : public numeric_limits<_Tp> { }; + + template<typename _Tp> + struct numeric_limits<volatile _Tp> + : public numeric_limits<_Tp> { }; + + template<typename _Tp> + struct numeric_limits<const volatile _Tp> + : public numeric_limits<_Tp> { }; +#endif + + // Now there follow 16 explicit specializations. Yes, 16. Make sure + // you get the count right. (18 in c++0x mode) /// numeric_limits<bool> specialization. template<> |

