aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/decimal
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-10-23 11:48:26 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-10-23 11:48:26 +0000
commit1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90 (patch)
treeabfafd40add6d5022e14f389c0552911026b882f /libstdc++-v3/include/decimal
parentfe15a1a7eb43bf486577d55e650222fb3479554f (diff)
downloadgcc-1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90.zip
gcc-1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90.tar.gz
gcc-1a0e9d1cb917e2d788a85cfb374ca9fb62bccf90.tar.bz2
re PR libstdc++/58815 (Casting/Conversion operator for std::decimal not supported)
2013-10-23 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/58815 * include/decimal/decimal (decimal32::operator long long(), decimal64::operator long long(), decimal128::operator long long()): Add in c++11 mode per n3407. * testsuite/decimal/pr58815.cc: New. From-SVN: r203956
Diffstat (limited to 'libstdc++-v3/include/decimal')
-rw-r--r--libstdc++-v3/include/decimal/decimal21
1 files changed, 15 insertions, 6 deletions
diff --git a/libstdc++-v3/include/decimal/decimal b/libstdc++-v3/include/decimal/decimal
index a880537..c160118 100644
--- a/libstdc++-v3/include/decimal/decimal
+++ b/libstdc++-v3/include/decimal/decimal
@@ -250,8 +250,11 @@ namespace decimal
/// Conforming extension: Conversion from scalar decimal type.
decimal32(__decfloat32 __z) : __val(__z) {}
- // 3.2.2.5 Conversion to integral type. (DISABLED)
- //operator long long() const { return (long long)__val; }
+#if __cplusplus >= 201103L
+ // 3.2.2.5 Conversion to integral type.
+ // Note: explicit per n3407.
+ explicit operator long long() const { return (long long)__val; }
+#endif
// 3.2.2.6 Increment and decrement operators.
decimal32& operator++()
@@ -333,8 +336,11 @@ namespace decimal
/// Conforming extension: Conversion from scalar decimal type.
decimal64(__decfloat64 __z) : __val(__z) {}
- // 3.2.3.5 Conversion to integral type. (DISABLED)
- //operator long long() const { return (long long)__val; }
+#if __cplusplus >= 201103L
+ // 3.2.3.5 Conversion to integral type.
+ // Note: explicit per n3407.
+ explicit operator long long() const { return (long long)__val; }
+#endif
// 3.2.3.6 Increment and decrement operators.
decimal64& operator++()
@@ -417,8 +423,11 @@ namespace decimal
/// Conforming extension: Conversion from scalar decimal type.
decimal128(__decfloat128 __z) : __val(__z) {}
- // 3.2.4.5 Conversion to integral type. (DISABLED)
- //operator long long() const { return (long long)__val; }
+#if __cplusplus >= 201103L
+ // 3.2.4.5 Conversion to integral type.
+ // Note: explicit per n3407.
+ explicit operator long long() const { return (long long)__val; }
+#endif
// 3.2.4.6 Increment and decrement operators.
decimal128& operator++()