aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/complex
diff options
context:
space:
mode:
Diffstat (limited to 'system/include/libcxx/complex')
-rw-r--r--system/include/libcxx/complex55
1 files changed, 48 insertions, 7 deletions
diff --git a/system/include/libcxx/complex b/system/include/libcxx/complex
index dddc58e0..2943da1d 100644
--- a/system/include/libcxx/complex
+++ b/system/include/libcxx/complex
@@ -255,13 +255,13 @@ template<class T, class charT, class traits>
_LIBCPP_BEGIN_NAMESPACE_STD
-template<class _Tp> class _LIBCPP_TYPE_VIS complex;
+template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY complex;
template<class _Tp> complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w);
template<class _Tp> complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y);
template<class _Tp>
-class _LIBCPP_TYPE_VIS complex
+class _LIBCPP_TYPE_VIS_ONLY complex
{
public:
typedef _Tp value_type;
@@ -319,11 +319,11 @@ public:
}
};
-template<> class _LIBCPP_TYPE_VIS complex<double>;
-template<> class _LIBCPP_TYPE_VIS complex<long double>;
+template<> class _LIBCPP_TYPE_VIS_ONLY complex<double>;
+template<> class _LIBCPP_TYPE_VIS_ONLY complex<long double>;
template<>
-class _LIBCPP_TYPE_VIS complex<float>
+class _LIBCPP_TYPE_VIS_ONLY complex<float>
{
float __re_;
float __im_;
@@ -379,7 +379,7 @@ public:
};
template<>
-class _LIBCPP_TYPE_VIS complex<double>
+class _LIBCPP_TYPE_VIS_ONLY complex<double>
{
double __re_;
double __im_;
@@ -435,7 +435,7 @@ public:
};
template<>
-class _LIBCPP_TYPE_VIS complex<long double>
+class _LIBCPP_TYPE_VIS_ONLY complex<long double>
{
long double __re_;
long double __im_;
@@ -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