summaryrefslogtreecommitdiffstats
path: root/libcxx/include/complex
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2013-10-05 21:19:49 +0000
committerMarshall Clow <mclow.lists@gmail.com>2013-10-05 21:19:49 +0000
commitea7c7cc5217056c4845f4d235f6787d7077b8ba1 (patch)
treea910d40217018d168cf5f33d54b8d1869b4fe201 /libcxx/include/complex
parent3ceafc7f0152bd9e41e5adbafd0a8a8af418f08d (diff)
downloadbcm5719-llvm-ea7c7cc5217056c4845f4d235f6787d7077b8ba1.tar.gz
bcm5719-llvm-ea7c7cc5217056c4845f4d235f6787d7077b8ba1.zip
Implement literal suffixes for compled
llvm-svn: 192048
Diffstat (limited to 'libcxx/include/complex')
-rw-r--r--libcxx/include/complex41
1 files changed, 41 insertions, 0 deletions
diff --git a/libcxx/include/complex b/libcxx/include/complex
index e1d72f4d596..2943da1d775 100644
--- a/libcxx/include/complex
+++ b/libcxx/include/complex
@@ -1521,6 +1521,47 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x)
return __os << __s.str();
}
+#if _LIBCPP_STD_VER > 11
+// Literal suffix for complex number literals [complex.literals]
+inline namespace literals
+{
+ inline namespace complex_literals
+ {
+ constexpr complex<long double> operator""il(long double __im)
+ {
+ return { 0.0l, __im };
+ }
+
+ constexpr complex<long double> operator""il(unsigned long long __im)
+ {
+ return { 0.0l, static_cast<long double>(__im) };
+ }
+
+
+ constexpr complex<double> operator""i(long double __im)
+ {
+ return { 0.0, static_cast<double>(__im) };
+ }
+
+ constexpr complex<double> operator""i(unsigned long long __im)
+ {
+ return { 0.0, static_cast<double>(__im) };
+ }
+
+
+ constexpr complex<float> operator""if(long double __im)
+ {
+ return { 0.0f, static_cast<float>(__im) };
+ }
+
+ constexpr complex<float> operator""if(unsigned long long __im)
+ {
+ return { 0.0f, static_cast<float>(__im) };
+ }
+ }
+}
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_COMPLEX
OpenPOWER on IntegriCloud