1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00
Sprout/sprout/complex/udl.hpp

71 lines
2.1 KiB
C++
Raw Normal View History

2013-08-08 09:54:33 +00:00
/*=============================================================================
2016-02-25 09:48:28 +00:00
Copyright (c) 2011-2016 Bolero MURAKAMI
2013-08-08 09:54:33 +00:00
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_COMPLEX_UDL_HPP
#define SPROUT_COMPLEX_UDL_HPP
#include <sprout/config.hpp>
#include <sprout/complex/complex.hpp>
#if SPROUT_USE_USER_DEFINED_LITERALS
namespace sprout {
namespace udl {
namespace complex {
//
// _i
//
inline SPROUT_CONSTEXPR sprout::complex<double>
operator"" _i(long double x) {
return sprout::complex<double>(0, x);
}
//
// _if
// _iF
//
inline SPROUT_CONSTEXPR sprout::complex<float>
operator"" _if(long double x) {
2015-12-09 10:54:35 +00:00
return sprout::complex<float>(0, static_cast<float>(x));
}
inline SPROUT_CONSTEXPR sprout::complex<float>
operator"" _iF(long double x) {
2015-12-09 10:54:35 +00:00
return sprout::complex<float>(0, static_cast<float>(x));
}
//
// _il
// _iL
//
inline SPROUT_CONSTEXPR sprout::complex<long double>
operator"" _il(long double x) {
return sprout::complex<long double>(0, x);
}
inline SPROUT_CONSTEXPR sprout::complex<long double>
operator"" _iL(long double x) {
return sprout::complex<long double>(0, x);
}
} // namespace complex
using sprout::udl::complex::operator"" _i;
using sprout::udl::complex::operator"" _if;
using sprout::udl::complex::operator"" _iF;
using sprout::udl::complex::operator"" _il;
using sprout::udl::complex::operator"" _iL;
} // namespace udl
using sprout::udl::complex::operator"" _i;
using sprout::udl::complex::operator"" _if;
using sprout::udl::complex::operator"" _iF;
using sprout::udl::complex::operator"" _il;
using sprout::udl::complex::operator"" _iL;
} // namespace sprout
#endif // #if SPROUT_USE_USER_DEFINED_LITERALS
#endif // #ifndef SPROUT_COMPLEX_UDL_HPP