mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
[test][util][promote integral] (re-)implement bit_size locally in the unit test
This commit is contained in:
parent
7b515316e7
commit
1b92041500
@ -148,10 +148,40 @@ struct test_max_values<Integral, Promoted, false>
|
|||||||
|
|
||||||
|
|
||||||
// helper function that returns the bit size of a type
|
// helper function that returns the bit size of a type
|
||||||
|
template
|
||||||
|
<
|
||||||
|
typename T,
|
||||||
|
bool IsFundamental = boost::is_fundamental<T>::type::value
|
||||||
|
>
|
||||||
|
struct bit_size_impl : boost::mpl::size_t<0>
|
||||||
|
{};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct bit_size_impl<T, true> : bg::detail::promote_integral::bit_size<T>::type
|
||||||
|
{};
|
||||||
|
|
||||||
|
#if !defined(BOOST_GEOMETRY_NO_MULTIPRECISION_INTEGER)
|
||||||
|
template
|
||||||
|
<
|
||||||
|
typename Backend,
|
||||||
|
boost::multiprecision::expression_template_option ExpressionTemplates
|
||||||
|
>
|
||||||
|
struct bit_size_impl
|
||||||
|
<
|
||||||
|
boost::multiprecision::number<Backend, ExpressionTemplates>,
|
||||||
|
false
|
||||||
|
> : bg::detail::promote_integral::bit_size
|
||||||
|
<
|
||||||
|
boost::multiprecision::number<Backend, ExpressionTemplates>
|
||||||
|
>
|
||||||
|
{};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::size_t bit_size()
|
std::size_t bit_size()
|
||||||
{
|
{
|
||||||
return bg::detail::promote_integral::bit_size<T>::type::value;
|
return bit_size_impl<T>::type::value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool PromoteUnsignedToUnsigned>
|
template <bool PromoteUnsignedToUnsigned>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user