Translates an as type wrapper to a type wrapper of its translated type.
Translates an as type wrapper to a type wrapper of its translated type.
- Template Parameters
-
| V | The wrapper type to translate |
- Returns
- Type tag for the translated type
enum class E: int { };
constexpr translate_t< V > translate(V const &val)
Translates a value to its translated type.
Definition as_translation.hpp:28
Lightweight type-wrapper.
Definition as.hpp:29
#pragma once
#include <eve/concept/translation.hpp>
#include <eve/detail/wide_forward.hpp>
#include <eve/memory/pointer.hpp>
#include <eve/traits/value_type.hpp>
#include <eve/traits/pointer.hpp>
#include <bit>
#include <new>
{
template <typename V>
{
}
template <typename T, size_t N>
constexpr std::array<translate_t<T>, N>
translate(std::array<T, N>
val)
{
}
template <typename V>
{
}
template <typename V>
{
}
template <detail::scalar_pointer Ptr>
constexpr auto translate_ptr(
Ptr ptr)
{
{
using trans_t = detail::copy_qualifiers_t<translated_value_type_t<Ptr>,
Ptr>;
if constexpr (std::is_pointer_v<Ptr>)
{
return std::launder(
reinterpret_cast<trans_t*
>(ptr));
}
else
{
return std::bit_cast<typename Ptr::template rebind<trans_t>>(ptr);
}
}
else
{
return ptr;
}
}
template <typename Dst, translatable_into<Dst> Src>
{
return std::bit_cast<Dst>(
val);
}
}
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107
EVE Main Namespace.
Definition abi.hpp:19