E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches
eve::translatable_struct Concept Reference

Defines the requirements for a struct to be translatable. More...

#include <eve/traits/translation.hpp>

Detailed Description

Template Parameters
TThe translation candidate type

T must satisfy this concept in order to be safely used as a translatable type. T and its translation target must have the same size and alignment. T must be trivially copyable, and assignable to guarantee that scalar operations produce the same results as vectorized operations executed on values of T when observed as their translation targets.

Note
While T is not required to be trivially constructible, a constructor of T initializing it with anything other than its default value, or having side-effects can lead to undefined or unexpected behavior when used in vectorized operations. This also applies to the overload of any operator of T that is also available for its translation target.

Concept definition

template<typename T>
concept eve::translatable_struct = std::is_trivially_copyable_v<T>
&& std::is_trivially_assignable_v<T&, T>
&& (sizeof(T) == sizeof(typename translation_of<T>::type))
&& (alignof(T) == alignof(typename translation_of<T>::type))
Defines the requirements for a struct to be translatable.
Definition translation.hpp:62
typename decltype(detail::as_translated_type(as< T >{}))::type translate_t
Returns the final translated type of T.
Definition translation.hpp:107