aboutsummaryrefslogtreecommitdiff
path: root/system/include/libcxx/complex
diff options
context:
space:
mode:
authorBruce Mitchener <bruce.mitchener@gmail.com>2013-11-07 15:49:37 +0700
committerBruce Mitchener <bruce.mitchener@gmail.com>2013-11-07 16:07:18 +0700
commit44af976a44bc194b985fdb880f99a7feff133b5a (patch)
tree400fb651d819c41e26b417d36a4315ec947fd387 /system/include/libcxx/complex
parent7f870cf9c357f6a1138ba612ace7d7249f85e250 (diff)
Update libcxx to 194185, 2013-11-07.
This brings C++14 support.
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