Config: check for 'long long' support
[sol.git] / sol / math / sign.hpp
blob9af8b2e1dc84d7a2e991f5c805e46030b7676a28
1 #if !defined(sol_math_sign_hpp_included)
2 #define sol_math_sign_hpp_included
3 /// \addtogroup sol_math
4 /// \{
7 /**
8 * \file sol/math/sign.hpp
9 * \brief Compile-time sign taking
10 * \author Sven Suursoho
14 #include <sol/cstdint.hpp>
15 #include <sol/utility/integral_constant.hpp>
18 namespace sol { namespace math {
21 /// Take sign of V during compile-time
22 template <intmax_t V>
23 struct sign
24 : integral_constant<intmax_t, (V < 0) ? -1 : 1>
25 {};
28 }} // namespace sol::math
31 /// \}
32 #endif // sol_math_sign_hpp_included