This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58815] Casting/Conversion operator for std::decimal not supported
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 22 Oct 2013 09:11:40 +0000
- Subject: [Bug c++/58815] Casting/Conversion operator for std::decimal not supported
- Auto-submitted: auto-generated
- References: <bug-58815-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58815
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Something like:
Index: include/decimal/decimal
===================================================================
--- include/decimal/decimal (revision 203915)
+++ include/decimal/decimal (working copy)
@@ -250,8 +250,10 @@
/// 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.
+ explicit operator long long() const { return (long long)__val; }
+#endif
// 3.2.2.6 Increment and decrement operators.
decimal32& operator++()
@@ -333,8 +335,10 @@
/// 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.
+ explicit operator long long() const { return (long long)__val; }
+#endif
// 3.2.3.6 Increment and decrement operators.
decimal64& operator++()
@@ -417,8 +421,10 @@
/// 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.
+ explicit operator long long() const { return (long long)__val; }
+#endif
// 3.2.4.6 Increment and decrement operators.
decimal128& operator++()