Skip to content
Snippets Groups Projects
Commit e42c96cc authored by Philip Trettner's avatar Philip Trettner
Browse files

Merge branch 'jn/develop' into 'develop'

Added make_(un)signed

See merge request !98
parents f8a5e563 f7287eea
No related branches found
No related tags found
1 merge request!98Added make_(un)signed
......@@ -113,4 +113,20 @@ struct is_scalar_t<angle_t<T>>
// abstract scalars are scalars that don't hold a concrete values (e.g. traced types)
TG_IMPL_DEFINE_TRAIT(is_abstract_scalar, bool, false);
template <class T>
struct make_unsigned_t
{
using type = std::make_unsigned_t<T>;
};
template <class T>
using make_unsigned = typename make_unsigned_t<T>::type;
template <class T>
struct make_signed_t
{
using type = std::make_signed_t<T>;
};
template <class T>
using make_signed = typename make_signed_t<T>::type;
} // namespace tg
#pragma once
#include <typed-geometry/detail/scalar_traits.hh>
#include <typed-geometry/types/scalars/fixed_int.hh>
#include <typed-geometry/types/scalars/fixed_uint.hh>
......@@ -30,4 +31,45 @@ constexpr fixed_uint<words>::fixed_uint(fixed_int<rhs_words> const& rhs)
if constexpr (rhs_words > 3 && words > 3)
d[3] = rhs.d[3];
}
template <int w>
struct make_unsigned_t<fixed_int<w>>
{
using type = fixed_uint<w>;
};
template <int w>
struct make_unsigned_t<fixed_int<w> const>
{
using type = fixed_uint<w> const;
};
template <int w>
struct make_unsigned_t<fixed_uint<w>>
{
using type = fixed_uint<w>;
};
template <int w>
struct make_unsigned_t<fixed_uint<w> const>
{
using type = fixed_uint<w> const;
};
template <int w>
struct make_signed_t<fixed_uint<w>>
{
using type = fixed_int<w>;
};
template <int w>
struct make_signed_t<fixed_uint<w> const>
{
using type = fixed_int<w> const;
};
template <int w>
struct make_signed_t<fixed_int<w>>
{
using type = fixed_int<w>;
};
template <int w>
struct make_signed_t<fixed_int<w> const>
{
using type = fixed_int<w> const;
};
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment