rstd 0.1.0
Loading...
Searching...
No Matches
rstd.basic Module Reference

Concepts

concept  rstd::mtp::same_as
 Satisfied when T and U are the same type.
 
concept  rstd::mtp::same
 Satisfied when T is the same as all of Rest....
 
concept  rstd::mtp::any
 Satisfied when T is the same as any of Rest....
 
concept  rstd::mtp::convertible_to
 Satisfied when From is implicitly and explicitly convertible to To.
 
concept  rstd::mtp::equalable
 Satisfied when T and U can be compared with == and !=.
 
concept  rstd::mtp::transparent
 Satisfied when S has the same size and alignment as T and is standard-layout.
 
concept  rstd::mtp::init
 Satisfied when T is constructible from Args....
 
concept  rstd::mtp::drop
 Satisfied when T is nothrow destructible.
 
concept  rstd::mtp::copy
 Satisfied when T is copy constructible.
 
concept  rstd::mtp::move
 Satisfied when T is move constructible.
 
concept  rstd::mtp::assign
 Satisfied when U can be assigned to T.
 
concept  rstd::mtp::assign_copy
 Satisfied when T is copy assignable.
 
concept  rstd::mtp::assign_move
 Satisfied when T is move assignable.
 
concept  rstd::mtp::triv
 Is trivial.
 
concept  rstd::mtp::triv_init
 Is trivially constructible.
 
concept  rstd::mtp::triv_drop
 Is trivially destructible.
 
concept  rstd::mtp::triv_copy
 Is trivially copyable.
 
concept  rstd::mtp::triv_move
 Is trivially moveable.
 
concept  rstd::mtp::triv_assign
 Is trivially assignable.
 
concept  rstd::mtp::triv_assign_copy
 Is trivially copy assignable.
 
concept  rstd::mtp::triv_assign_move
 Is trivially move assignable.
 
concept  rstd::mtp::noex_init
 Is nothrow constructible.
 
concept  rstd::mtp::noex_assign
 Is nothrow assignable.
 
concept  rstd::mtp::noex_copy
 Is nothrow copy construcible.
 
concept  rstd::mtp::noex_move
 Is nothrow move construcible.
 
concept  rstd::mtp::noex_assign_copy
 Is nothrow copy assignable.
 
concept  rstd::mtp::noex_assign_move
 Is nothrow move assignable.
 
concept  rstd::mtp::noex_drop
 Is no throw destructible.
 
concept  rstd::mtp::user_move
 Has a user-defined (non-trivial) move constructor.
 
concept  rstd::mtp::user_assign_copy
 Has a user-defined (non-trivial) copy assignment operator.
 
concept  rstd::mtp::user_assign_move
 Has a user-defined (non-trivial) move assignment operator.
 
concept  rstd::mtp::is_int
 Satisfied when T is an integral type.
 
concept  rstd::mtp::is_float
 Satisfied when T is a floating-point type.
 
concept  rstd::mtp::is_arithmetic
 Satisfied when T is an arithmetic (integral or floating-point) type.
 
concept  rstd::mtp::is_ref
 Satisfied when T is a reference type (lvalue or rvalue).
 
concept  rstd::mtp::is_ref_lv
 Satisfied when T is an lvalue reference.
 
concept  rstd::mtp::is_ref_rv
 Satisfied when T is an rvalue reference.
 
concept  rstd::mtp::is_enum
 Satisfied when T is an enumeration type.
 
concept  rstd::mtp::is_union
 Satisfied when T is a union type.
 
concept  rstd::mtp::is_class
 Satisfied when T is a class or struct type.
 
concept  rstd::mtp::is_array
 Satisfied when T is an array type.
 
concept  rstd::mtp::is_array_dst
 Satisfied when T is an array type with unknown bound.
 
concept  rstd::mtp::is_tuple
 Satisfied when T is a tuple-like type (has tuple_size).
 
concept  rstd::mtp::is_aggregate
 Satisfied when T is an aggregate type.
 
concept  rstd::mtp::is_base_of
 Satisfied when Base is a base class of Derived.
 
concept  rstd::mtp::spec_of
 Satisfied when T is a specialization of the template Primary.
 
concept  rstd::mtp::complete
 Satisfied when T is a complete type.
 

Classes

struct  rstd::mtp::func_traits< T >
 Extracts metadata from function pointer and member function pointer types. More...
 
struct  rstd::empty
 A zero-sized type, analogous to Rust's () (unit). More...
 
struct  rstd::emptyT< typename >
 A zero-sized phantom type parameterized on T. More...
 
class  rstd::tuple< Ts >
 A fixed-size heterogeneous collection of values, analogous to Rust's tuple. More...
 
struct  rstd::panic_::Location
 A cross-ABI-safe source location, analogous to Rust's core::panic::Location. More...
 
struct  rstd::panic_::PanicInfo
 Carries information about a panic, analogous to Rust's core::panic::PanicInfo. More...
 
struct  rstd::panic_::SrcLoc
 Consteval wrapper for source_location to capture the caller's location as a default parameter. More...
 

Typedefs

template<typename T >
using rstd::mtp::void_empty_t = cond<is_void<T>, empty, T>
 Maps void to empty, otherwise yields T.
 
template<typename T , typename U >
using rstd::mtp::follow_const_t
 Propagates the const-ness of T onto U.
 
using rstd::i8 = ::int8_t
 8-bit signed integer.
 
using rstd::i16 = ::int16_t
 16-bit signed integer.
 
using rstd::i32 = ::int32_t
 32-bit signed integer.
 
using rstd::i64 = ::int64_t
 64-bit signed integer.
 
using rstd::u8 = ::uint8_t
 8-bit unsigned integer.
 
using rstd::u16 = ::uint16_t
 16-bit unsigned integer.
 
using rstd::u32 = ::uint32_t
 32-bit unsigned integer.
 
using rstd::u64 = ::uint64_t
 64-bit unsigned integer.
 
using rstd::u128 = unsigned __int128
 128-bit unsigned integer.
 
using rstd::i128 = __int128
 128-bit signed integer.
 
using rstd::idx = ::ptrdiff_t
 Signed index type, equivalent to Rust's isize used for offsets.
 
using rstd::usize = ::size_t
 Pointer-sized unsigned integer, equivalent to Rust's usize.
 
using rstd::isize = ::intptr_t
 Pointer-sized signed integer, equivalent to Rust's isize.
 
using rstd::voidp = void*
 Mutable void pointer.
 
using rstd::const_voidp = void const*
 Const void pointer.
 
using rstd::usizeptr = ::uintptr_t
 Integer type guaranteed to hold a pointer value.
 
using rstd::panic_::WriteFn = bool (*)(void*, u8 const*, usize)
 Function pointer type for writing panic message bytes.
 

Functions

template<typename T >
constexpr auto rstd::addressof (T &val) noexcept -> T *
 Obtains the actual address of an object, even if operator& is overloaded.
 
template<typename T , typename U = T>
constexpr T rstd::exchange (T &obj, U &&new_val) noexcept(mtp::noex_move< T > &&mtp::noex_assign< T &, U >)
 Replaces obj with new_val, returning the old value.
 
template<typename T , typename... Args>
requires (! mtp::is_array_dst<T>) && requires { new T{mtp::declval<Args>()...}; }
constexpr T * rstd::construct_at (T *location, Args &&... args) noexcept(noexcept(new T{mtp::declval< Args >()...}))
 Constructs an object of type T at the given memory location.
 
template<typename T >
constexpr void rstd::destroy_at (T *location)
 Destroys the object at the given location by calling its destructor.
 
template<typename T >
constexpr T * rstd::launder (T *__p) noexcept
 Obtains a pointer to an object created in storage occupied by another object of the same type.
 
constexpr auto rstd::strlen (char const *s) noexcept -> usize
 Returns the length of a null-terminated byte string.
 
template<typename To , typename From >
requires (sizeof(To) == sizeof(From)) && mtp::triv_copy<To> && mtp::triv_copy<From>
constexpr To rstd::bit_cast (const From &from) noexcept
 Reinterprets the bits of from as a value of type To.
 
void rstd::unreachable ()
 Informs the compiler that this point in the code is unreachable.
 
template<typename T >
void rstd::swap (T &a, T &b) noexcept(mtp::noex_copy< T >)
 Swaps the values of a and b.
 
template<typename T >
constexpr auto rstd::min (T a, T b) noexcept -> T
 Returns the smaller of two values.
 
template<typename InputIter1 , typename InputIter2 >
constexpr auto rstd::lexicographical_compare_three_way (InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2)
 Performs lexicographic three-way comparison of two ranges using <=>.
 
template<typename T >
auto rstd::mtp::declval () noexcept -> add_ref_rv< T >
 Utility to simplify expressions used in unevaluated operands.
 
constexpr bool rstd::mtp::is_constant_evaluated () noexcept
 Detects whether the current invocation occurs within a constant-evaluated context.
 
template<usize I, auto... Vals>
consteval auto rstd::mtp::get_auto ()
 Retrieves the I-th value from a non-type template parameter pack at compile time.
 
template<usize I, typename... Ts>
constexpr auto & rstd::get (tuple< Ts... > &t) noexcept
 Free function version of get<I>(t), for structured-binding compatibility.
 
template<typename... Ts>
constexpr auto rstd::make_tuple (Ts &&... ts)
 Creates a tuple, deducing element types from the arguments.
 
template<typename F , typename... Ts>
constexpr decltype(auto) rstd::apply (F &&f, tuple< Ts... > &t)
 Invokes f with the elements of t as individual arguments.
 
constexpr auto file_name () const noexcept -> const char *
 Returns the file name where this location was captured.
 
constexpr auto line () const noexcept -> u32
 Returns the line number.
 
constexpr auto column () const noexcept -> u32
 Returns the column number.
 
static constexpr auto from (sl_type sl) noexcept -> Location
 Creates a Location from a source_location.
 
consteval SrcLoc (sl_type v=sl_type::current()) noexcept
 Implicitly captures the caller's source location at compile time.
 

Variables

template<typename T >
constexpr type_identity< T > rstd::mtp::type_c {}
 Compile-time type tag for T.
 
void const * data
 Opaque pointer to the panic payload.
 
bool(* fmt )(void const *data, void *ctx, WriteFn write)
 Formats the panic payload by writing bytes through write.
 
Location location
 The source location where the panic originated.
 
bool can_unwind = true
 Whether the panic is allowed to unwind the stack.
 
bool force_no_backtrace = false
 Whether to suppress backtrace generation.
 
sl_type val
 The captured source location value.
 

Access

Retrieves the underlying integer type of an enum.

template<typename T >
constexpr auto rstd::mtp::tuple_size = std::tuple_size<T>::value
 The number of elements in a tuple-like type.
 
template<usize I, typename T >
using rstd::mtp::tuple_element = std::tuple_element<I, T>::type
 The type of the I-th element in a tuple-like type.
 

type modifier

Applies array-to-pointer, function-to-pointer, and cv-removal transformations.

template<typename T >
using rstd::mtp::add_ptr
 Adds a pointer indirection to T.
 
template<typename T >
using rstd::mtp::add_ref = ::add_ref<T>::type
 Adds an lvalue reference to T.
 
template<typename T >
using rstd::mtp::add_ref_rv = ::add_ref_rv<T>::type
 Adds an rvalue reference to T.
 
template<typename T >
using rstd::mtp::add_const = ::add_const<T>::type
 Adds const qualification to T.
 
template<typename T >
using rstd::mtp::rm_const = ::rm_const<T>::type
 Removes const qualification from T.
 
template<typename T >
using rstd::mtp::rm_cv = __remove_cv(T)
 Removes top-level const and volatile qualifiers from T.
 
template<typename T >
using rstd::mtp::rm_ptr = __remove_pointer(T)
 Removes one level of pointer indirection from T.
 
template<typename T >
using rstd::mtp::rm_ref = ::rm_ref<T>::type
 Removes reference qualification from T.
 
template<typename T >
using rstd::mtp::rm_cvf = __remove_cvref(T)
 Removes reference and cv qualifiers from T.
 

Files

file  /home/runner/work/rstd/rstd/src/basic/mod.cppm
 
file  /home/runner/work/rstd/rstd/src/basic/basic.cppm
 
file  /home/runner/work/rstd/rstd/src/basic/mtp.cppm
 
file  /home/runner/work/rstd/rstd/src/basic/mtp.std.cppm
 
file  /home/runner/work/rstd/rstd/src/basic/panic_info.cppm
 
file  /home/runner/work/rstd/rstd/src/basic/prelude.cppm
 
file  /home/runner/work/rstd/rstd/src/basic/tuple.cppm