diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-08 15:56:02 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-08 15:56:02 -0800 |
commit | e0268fa1035a718341c53921eee9318d4a8033cd (patch) | |
tree | 2b3eeb07928f9521498332002444dbfa44f34dfb /system/include/libcxx/complex | |
parent | a11272805c16be75f5e6d00c8214afcac7ba9d05 (diff) | |
parent | ad1da1e6685d4483e096d7e0bbd8e38e686bd322 (diff) |
Merge pull request #1767 from waywardmonkeys/update-libcxx1.7.2
Update libcxx
Diffstat (limited to 'system/include/libcxx/complex')
-rw-r--r-- | system/include/libcxx/complex | 55 |
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 |