MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
Traits

Type traits (aka. More...

Concepts

concept  mtcore::Ostreamable
 The Ostreamable trait for types Something that implements this trait allows ostream operations.
 
concept  mtcore::Addressable
 The Addressable trait for types Something that implements this trait allows addressing items by index.
 
concept  mtcore::MutableAddressable
 The Addressable trait for types Something that implements this trait allows addressing items by index.
 
concept  mtcore::Iterator
 The Addressable trait for types Something that implements this trait allows addressing items by index.
 
concept  mtcore::Iterable
 The Iterable trait for types Something that implements this trait can give an iterator to iterate over the elements.
 
concept  mtcore::StdIterable
 Detect if something is C++ standard iterable.
 
concept  mtcore::DefaultDeinit
 Represents a type that has a default (no allocator) deinit method.
 
concept  mtcore::AllocatorDeinit
 Represents a type that has a deinit which takes an allocator (usually does memory cleanup)
 
concept  mtcore::ResultLike
 Represents a type that fulfills the "result" contract.
 
concept  mtcore::ResultLikeWithValue
 Represents a type that fulfills the "result" contract while having a success value of a specific type Does NOT check the error value (the error can be of any type)
 
concept  mtcore::ResultLikeWithVoid
 Represents a type that fulfills the "result" contract while having no success value Does NOT check the error value (the error can be of any type)
 
concept  mtcore::WriterImpl
 Represents an implementation of a writer (basically checks if the type can be wrapped with Writer<>)
 
concept  mtcore::WriterImplBytes
 Represents an implementation of a writer that we can get how many bytes were written.
 
concept  mtcore::WriterImplWritten
 Represents an implementation of a writer that we can get the output.
 
concept  mtcore::WriterImplResettable
 Represents an implementation of a writer that we can reset.
 
concept  mtcore::ReaderImpl
 Represents an implementation of a reader (basically checks if the type can be wrapped with Reader<>)
 
concept  mtcore::Formattable
 Represents a type that can be formatted.
 
concept  mtcore::thread::SelectOption
 Checks if something qualifies as an option to a select statement Allows defining custom options and cases.
 
concept  mtcore::thread::Closeable
 Checks if something is closeable (e.g.
 
concept  mtcore::thread::Sender
 Checks if messages can be sent to something (e.g.
 
concept  mtcore::thread::Receiver
 Checks if messages can be received from something (e.g.
 
concept  mtcore::thread::SenderBlock
 Checks if messages can be sent in a blocking manner.
 
concept  mtcore::thread::ReceiverBlock
 Checks if messages can be received in a blocking manner.
 
concept  mtcore::thread::SenderBefore
 Checks if messages can be sent in a blocking manner with a timeout.
 
concept  mtcore::thread::ReceiverBefore
 Checks if messages can be received in a blocking manner with a timeout.
 
concept  mtcore::thread::SenderGrow
 Checks if messages can be sent to something (e.g.
 
concept  mtcore::thread::SenderBlockGrow
 Checks if messages can be sent to something (e.g.
 
concept  mtcore::thread::SenderBeforeGrow
 Checks if messages can be sent to something (e.g.
 
concept  mtcore::thread::HasClosedError
 Checks if an error type has a "Has Closed" error called CHANNEL_CLOSED.
 
concept  mtcore::thread::SenderReceiver
 Checks if non-blocking sends and receives are supported.
 
concept  mtcore::thread::SenderReceiverBlock
 Checks if blocking sends and receives are supported.
 
concept  mtcore::thread::SenderReceiverBefore
 Checks if blocking with timeout sends and receives are supported.
 
concept  mtcore::thread::SenderReceiverGrow
 Checks if non-blocking sends and receives are supported with allocation to grow.
 
concept  mtcore::thread::SenderReceiverBlockGrow
 Checks if blocking sends and receives are supported with allocation to grow.
 
concept  mtcore::thread::SenderReceiverBeforeGrow
 Checks if blocking with timeout sends and receives are supported with allocation to grow.
 
concept  mtcore::thread::ChannelLike
 Checks if something qualifies as a channel Channels can:
 
concept  mtcore::thread::ChannelLikeGrow
 Checks if something qualifies as a growing channel Growing channels can:
 

Variables

template<typename T, typename V>
constexpr bool mtcore::is_result_with_value = impl::IsResultWithValue<V, T>::value
 Checks if a type is result-like with a success value type.
 
template<typename T>
constexpr bool mtcore::is_result_void = impl::IsResultWithValue<void, T>::value
 Checks if a type is result-like with no success value.
 
template<typename T>
constexpr bool mtcore::is_addressable = impl::IsAddressable<T>::value
 Boolean check for if something has the trait Addressable.
 
template<typename T>
constexpr bool mtcore::is_mutable_addressable = impl::IsAddressable<T>::value
 Boolean check for if something has the trait Addressable.
 
template<typename T>
constexpr bool mtcore::is_ostreamable = impl::IsOstreamable<T>::value
 Boolean check for if something has the trait Iterator.
 
template<typename T>
constexpr bool mtcore::is_iterator = impl::IsIterator<T>::value
 Boolean check for if something has the trait Iterator.
 
template<typename T>
constexpr bool mtcore::is_flushable = impl::IsFlushable<T>::value
 Boolean check for if something has the trait Flushable.
 
template<typename T>
constexpr bool mtcore::is_allocator_deinit = impl::IsAllocatorDeinit<T>::value
 Checks if a type requires an allocator to deinit.
 
template<typename T, typename... Args>
constexpr bool mtcore::is_initable = impl::IsInitable<T, Args...>::value
 Checks if a type has an init with the param types.
 
template<typename T>
constexpr bool mtcore::is_formattable = impl::IsFormattable<T>::value
 Checks if a type has a zero-parameter deinit.
 
template<typename T>
constexpr bool mtcore::is_default_deinit = impl::IsDefaultDeinit<T>::value
 Checks if a type has a zero-parameter deinit.
 
template<typename T>
constexpr bool mtcore::thread::has_closed_error = impl::IsHasClosedError<T>::value
 Checks if an error type has a recognized closed error.
 
template<typename T>
constexpr bool mtcore::thread::is_closeable = impl::IsCloseable<T>::value
 Checks if a type is closeable.
 
template<typename T>
constexpr bool mtcore::thread::is_sender = impl::IsSender<T>::value
 Checks if a type can be sent to.
 
template<typename T>
constexpr bool mtcore::thread::is_sender_grow = impl::IsSenderGrow<T>::value
 Checks if a type can be sent to with growing.
 
template<typename T>
constexpr bool mtcore::thread::is_sender_block = impl::IsSenderBlock<T>::value
 Checks if a type can be sent to (blocking)
 
template<typename T>
constexpr bool mtcore::thread::is_sender_block_grow = impl::IsSenderBlockGrow<T>::value
 Checks if a type can be sent to (blocking) with growing.
 
template<typename T>
constexpr bool mtcore::thread::is_sender_before = impl::IsSenderBefore<T>::value
 Checks if a type can be sent to (blocking, timeout)
 
template<typename T>
constexpr bool mtcore::thread::is_sender_before_grow = impl::IsSenderBeforeGrow<T>::value
 Checks if a type can be sent to (blocking, timeout) with growing.
 
template<typename T>
constexpr bool mtcore::thread::is_receiver = impl::IsReceiver<T>::value
 Checks if a type can be received from.
 
template<typename T>
constexpr bool mtcore::thread::is_receiver_block = impl::IsReceiverBlock<T>::value
 Checks if a type can be received from (blocking)
 
template<typename T>
constexpr bool mtcore::thread::is_receiver_before = impl::IsReceiverBefore<T>::value
 Checks if a type can be received from (blocking, timeout)
 
template<typename T>
constexpr bool mtcore::thread::is_sender_receiver = impl::IsSenderReceiver<T>::value
 Checks if a type can be sent to and received from.
 
template<typename T>
constexpr bool mtcore::thread::is_sender_receiver_grow = impl::IsSenderReceiverGrow<T>::value
 Checks if a type can be sent to and received from with growing send.
 
template<typename T>
constexpr bool mtcore::thread::is_sender_receiver_block = impl::IsSenderReceiverBlock<T>::value
 Checks if a type can be sent to and received from (blocking)
 
template<typename T>
constexpr bool mtcore::thread::is_sender_receiver_block_grow = impl::IsSenderReceiverBlockGrow<T>::value
 Checks if a type can be sent to and received from (blocking) with growing send.
 
template<typename T>
constexpr bool mtcore::thread::is_sender_receiver_before = impl::IsSenderReceiverBefore<T>::value
 Checks if a type can be sent to and received from (blocking, timeout)
 
template<typename T>
constexpr bool mtcore::thread::is_sender_receiver_before_grow = impl::IsSenderReceiverBeforeGrow<T>::value
 Checks if a type can be sent to and received from (blocking, timeout) with growing send.
 
template<typename T>
constexpr bool mtcore::thread::is_channel_like = impl::IsChannelLike<T>::value
 Checks if a type is channel-like.
 
template<typename T>
constexpr bool mtcore::thread::is_channel_like_grow = impl::IsChannelLikeGrow<T>::value
 Checks if a type is growing channel-like.
 
template<typename T>
constexpr bool mtcore::thread::is_select_option = impl::IsSelectOption<T>::value
 Checks if a type can be used in a select statement as an option.
 

Detailed Description

Type traits (aka.

C++ concepts) describing what types can and cannot do. Can be used to specify constraints on template parameters

Variable Documentation

◆ has_closed_error

template<typename T>
bool mtcore::thread::has_closed_error = impl::IsHasClosedError<T>::value
constexpr

Checks if an error type has a recognized closed error.

Template Parameters
TType to check

Definition at line 259 of file thread/mtcore_thread/traits.hpp.

◆ is_addressable

template<typename T>
bool mtcore::is_addressable = impl::IsAddressable<T>::value
constexpr

Boolean check for if something has the trait Addressable.

Definition at line 371 of file core/mtcore/traits.hpp.

◆ is_allocator_deinit

template<typename T>
bool mtcore::is_allocator_deinit = impl::IsAllocatorDeinit<T>::value
constexpr

Checks if a type requires an allocator to deinit.

Definition at line 406 of file core/mtcore/traits.hpp.

◆ is_channel_like

template<typename T>
bool mtcore::thread::is_channel_like = impl::IsChannelLike<T>::value
constexpr

Checks if a type is channel-like.

Template Parameters
TType to check

Definition at line 395 of file thread/mtcore_thread/traits.hpp.

◆ is_channel_like_grow

template<typename T>
bool mtcore::thread::is_channel_like_grow = impl::IsChannelLikeGrow<T>::value
constexpr

Checks if a type is growing channel-like.

Template Parameters
TType to check

Definition at line 403 of file thread/mtcore_thread/traits.hpp.

◆ is_closeable

template<typename T>
bool mtcore::thread::is_closeable = impl::IsCloseable<T>::value
constexpr

Checks if a type is closeable.

Template Parameters
TType to check

Definition at line 267 of file thread/mtcore_thread/traits.hpp.

◆ is_default_deinit

template<typename T>
bool mtcore::is_default_deinit = impl::IsDefaultDeinit<T>::value
constexpr

Checks if a type has a zero-parameter deinit.

Definition at line 427 of file core/mtcore/traits.hpp.

◆ is_flushable

template<typename T>
bool mtcore::is_flushable = impl::IsFlushable<T>::value
constexpr

Boolean check for if something has the trait Flushable.

Definition at line 399 of file core/mtcore/traits.hpp.

◆ is_formattable

template<typename T>
bool mtcore::is_formattable = impl::IsFormattable<T>::value
constexpr

Checks if a type has a zero-parameter deinit.

Definition at line 420 of file core/mtcore/traits.hpp.

◆ is_initable

template<typename T, typename... Args>
bool mtcore::is_initable = impl::IsInitable<T, Args...>::value
constexpr

Checks if a type has an init with the param types.

Definition at line 413 of file core/mtcore/traits.hpp.

◆ is_iterator

template<typename T>
bool mtcore::is_iterator = impl::IsIterator<T>::value
constexpr

Boolean check for if something has the trait Iterator.

Definition at line 392 of file core/mtcore/traits.hpp.

◆ is_mutable_addressable

template<typename T>
bool mtcore::is_mutable_addressable = impl::IsAddressable<T>::value
constexpr

Boolean check for if something has the trait Addressable.

Definition at line 378 of file core/mtcore/traits.hpp.

◆ is_ostreamable

template<typename T>
bool mtcore::is_ostreamable = impl::IsOstreamable<T>::value
constexpr

Boolean check for if something has the trait Iterator.

Definition at line 385 of file core/mtcore/traits.hpp.

◆ is_receiver

template<typename T>
bool mtcore::thread::is_receiver = impl::IsReceiver<T>::value
constexpr

Checks if a type can be received from.

Template Parameters
TType to check

Definition at line 323 of file thread/mtcore_thread/traits.hpp.

◆ is_receiver_before

template<typename T>
bool mtcore::thread::is_receiver_before = impl::IsReceiverBefore<T>::value
constexpr

Checks if a type can be received from (blocking, timeout)

Template Parameters
TType to check

Definition at line 339 of file thread/mtcore_thread/traits.hpp.

◆ is_receiver_block

template<typename T>
bool mtcore::thread::is_receiver_block = impl::IsReceiverBlock<T>::value
constexpr

Checks if a type can be received from (blocking)

Template Parameters
TType to check

Definition at line 331 of file thread/mtcore_thread/traits.hpp.

◆ is_result_void

template<typename T>
bool mtcore::is_result_void = impl::IsResultWithValue<void, T>::value
constexpr

Checks if a type is result-like with no success value.

Template Parameters
TType to check
VExpected success value

Definition at line 364 of file core/mtcore/traits.hpp.

◆ is_result_with_value

template<typename T, typename V>
bool mtcore::is_result_with_value = impl::IsResultWithValue<V, T>::value
constexpr

Checks if a type is result-like with a success value type.

Template Parameters
TType to check
VExpected success value

Definition at line 349 of file core/mtcore/traits.hpp.

◆ is_select_option

template<typename T>
bool mtcore::thread::is_select_option = impl::IsSelectOption<T>::value
constexpr

Checks if a type can be used in a select statement as an option.

Template Parameters
TType to check

Definition at line 411 of file thread/mtcore_thread/traits.hpp.

◆ is_sender

template<typename T>
bool mtcore::thread::is_sender = impl::IsSender<T>::value
constexpr

Checks if a type can be sent to.

Template Parameters
TType to check

Definition at line 275 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_before

template<typename T>
bool mtcore::thread::is_sender_before = impl::IsSenderBefore<T>::value
constexpr

Checks if a type can be sent to (blocking, timeout)

Template Parameters
TType to check

Definition at line 307 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_before_grow

template<typename T>
bool mtcore::thread::is_sender_before_grow = impl::IsSenderBeforeGrow<T>::value
constexpr

Checks if a type can be sent to (blocking, timeout) with growing.

Template Parameters
TType to check

Definition at line 315 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_block

template<typename T>
bool mtcore::thread::is_sender_block = impl::IsSenderBlock<T>::value
constexpr

Checks if a type can be sent to (blocking)

Template Parameters
TType to check

Definition at line 291 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_block_grow

template<typename T>
bool mtcore::thread::is_sender_block_grow = impl::IsSenderBlockGrow<T>::value
constexpr

Checks if a type can be sent to (blocking) with growing.

Template Parameters
TType to check

Definition at line 299 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_grow

template<typename T>
bool mtcore::thread::is_sender_grow = impl::IsSenderGrow<T>::value
constexpr

Checks if a type can be sent to with growing.

Template Parameters
TType to check

Definition at line 283 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_receiver

template<typename T>
bool mtcore::thread::is_sender_receiver = impl::IsSenderReceiver<T>::value
constexpr

Checks if a type can be sent to and received from.

Template Parameters
TType to check

Definition at line 347 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_receiver_before

template<typename T>
bool mtcore::thread::is_sender_receiver_before = impl::IsSenderReceiverBefore<T>::value
constexpr

Checks if a type can be sent to and received from (blocking, timeout)

Template Parameters
TType to check

Definition at line 379 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_receiver_before_grow

template<typename T>
bool mtcore::thread::is_sender_receiver_before_grow = impl::IsSenderReceiverBeforeGrow<T>::value
constexpr

Checks if a type can be sent to and received from (blocking, timeout) with growing send.

Template Parameters
TType to check

Definition at line 387 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_receiver_block

template<typename T>
bool mtcore::thread::is_sender_receiver_block = impl::IsSenderReceiverBlock<T>::value
constexpr

Checks if a type can be sent to and received from (blocking)

Template Parameters
TType to check

Definition at line 363 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_receiver_block_grow

template<typename T>
bool mtcore::thread::is_sender_receiver_block_grow = impl::IsSenderReceiverBlockGrow<T>::value
constexpr

Checks if a type can be sent to and received from (blocking) with growing send.

Template Parameters
TType to check

Definition at line 371 of file thread/mtcore_thread/traits.hpp.

◆ is_sender_receiver_grow

template<typename T>
bool mtcore::thread::is_sender_receiver_grow = impl::IsSenderReceiverGrow<T>::value
constexpr

Checks if a type can be sent to and received from with growing send.

Template Parameters
TType to check

Definition at line 355 of file thread/mtcore_thread/traits.hpp.