TRLC Platform Library  1.0.0
Header-only C++ library for compile-time platform detection and abstraction
trlc::platform::TypeInfo< Type > Struct Template Reference

#include <trlc/platform/typeinfo.hpp>

Static Public Attributes

static static size_t size = sizeof(Type)
 Size of the type in bytes. More...
 
static static size_t alignment = alignof(Type)
 Alignment requirement of the type in bytes. More...
 
static static bool is_cache_line_aligned = (alignment >= getCacheLineSize())
 True if the type's alignment is at least as strict as cache line alignment. More...
 
static static bool is_trivially_copyable = std::is_trivially_copyable_v<Type>
 True if the type is trivially copyable (can use memcpy) More...
 
static static bool is_standard_layout = std::is_standard_layout_v<Type>
 True if the type has standard layout (C-compatible layout) More...
 
static static bool is_pod = is_trivially_copyable && is_standard_layout
 True if the type is POD (Plain Old Data) More...
 
static static bool is_empty = std::is_empty_v<Type>
 True if the type is empty (size == 1 but no data members) More...
 
static static bool is_fundamental = std::is_fundamental_v<Type>
 True if the type is a fundamental type. More...
 
static static bool is_integral = std::is_integral_v<Type>
 True if the type is an integral type. More...
 
static static bool is_floating_point = std::is_floating_point_v<Type>
 True if the type is a floating point type. More...
 
static static bool is_pointer = std::is_pointer_v<Type>
 True if the type is a pointer type. More...
 
static static bool is_array = std::is_array_v<Type>
 True if the type is an array type. More...
 

Detailed Description

template<typename Type>
struct trlc::platform::TypeInfo< Type >

Examples
/home/tranglc/sources/trlc-platform/include/trlc/platform/typeinfo.hpp.

Definition at line 168 of file typeinfo.hpp.

Member Data Documentation

◆ alignment

template<typename Type >
static size_t trlc::platform::TypeInfo< Type >::alignment = alignof(Type)
static

Alignment requirement of the type in bytes.

Definition at line 173 of file typeinfo.hpp.

◆ is_array

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_array = std::is_array_v<Type>
static

True if the type is an array type.

Definition at line 203 of file typeinfo.hpp.

◆ is_cache_line_aligned

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_cache_line_aligned = (alignment >= getCacheLineSize())
static

True if the type's alignment is at least as strict as cache line alignment.

Definition at line 176 of file typeinfo.hpp.

◆ is_empty

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_empty = std::is_empty_v<Type>
static

True if the type is empty (size == 1 but no data members)

Definition at line 188 of file typeinfo.hpp.

◆ is_floating_point

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_floating_point = std::is_floating_point_v<Type>
static

True if the type is a floating point type.

Definition at line 197 of file typeinfo.hpp.

◆ is_fundamental

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_fundamental = std::is_fundamental_v<Type>
static

True if the type is a fundamental type.

Definition at line 191 of file typeinfo.hpp.

◆ is_integral

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_integral = std::is_integral_v<Type>
static

True if the type is an integral type.

Definition at line 194 of file typeinfo.hpp.

◆ is_pod

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_pod = is_trivially_copyable && is_standard_layout
static

True if the type is POD (Plain Old Data)

Definition at line 185 of file typeinfo.hpp.

◆ is_pointer

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_pointer = std::is_pointer_v<Type>
static

True if the type is a pointer type.

Definition at line 200 of file typeinfo.hpp.

◆ is_standard_layout

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_standard_layout = std::is_standard_layout_v<Type>
static

True if the type has standard layout (C-compatible layout)

Definition at line 182 of file typeinfo.hpp.

◆ is_trivially_copyable

template<typename Type >
static bool trlc::platform::TypeInfo< Type >::is_trivially_copyable = std::is_trivially_copyable_v<Type>
static

True if the type is trivially copyable (can use memcpy)

Definition at line 179 of file typeinfo.hpp.

◆ size

template<typename Type >
static size_t trlc::platform::TypeInfo< Type >::size = sizeof(Type)
static

Size of the type in bytes.

Definition at line 170 of file typeinfo.hpp.


The documentation for this struct was generated from the following file: