Language Utilities Utility classes allowing common C++ constructs. More...
Classes | |
struct | SC::AlignedStorage< N, Alignment > |
A buffer of bytes with given alignment. More... | |
struct | SC::Assert |
Functions and macros to assert, exit() or abort() and capture backtraces. More... | |
struct | SC::Deferred< F > |
Executes a function at end of current scope (in the spirit of Zig defer keyword). More... | |
struct | SC::Function< FuncType > |
Wraps function pointers, member functions and lambdas without ever allocating. More... | |
struct | SC::HeapBuffer |
A move-only owned buffer of bytes. More... | |
struct | SC::MaxValue |
An object that can be converted to any primitive type providing its max value. More... | |
struct | SC::Memory |
Centralized functions to allocate, reallocate and deallocate memory. More... | |
struct | SC::OpaqueObject< Definition > |
Hides implementation details from public headers (static PIMPL). More... | |
struct | SC::Result |
An ascii string used as boolean result. SC_TRY macro forwards errors to caller. More... | |
struct | SC::Span< Type > |
View over a contiguous sequence of items (pointer + size in elements). More... | |
struct | SC::StrongID< TagType, IDType, InvalidValue > |
Strongly typed ID (cannot be assigned incorrectly to another ID) More... | |
struct | SC::TaggedType< EnumType, enumValue, MemberType > |
Associate a Type to an Enum, as required by TaggedUnion. More... | |
struct | SC::TaggedUnion< Union > |
Type safe union with an enum type, where each type has an associated enum value. More... | |
struct | SC::UniqueHandle< Definition > |
Move only handle that has a special tag value flagging its invalid state. More... | |
Macros | |
#define | SC_TRY(expression) |
Checks the value of the given expression and if failed, returns this value to caller. More... | |
#define | SC_TRY_MSG(expression, failedMessage) |
Checks the value of the given expression and if failed, returns a result with failedMessage to caller. More... | |
#define | SC_TRUST_RESULT(expression) SC_ASSERT_RELEASE(expression) |
Asserts that the given result is valid. More... | |
Typedefs | |
template<typename T > | |
using | SC::Delegate = Function< void(T)> |
using | SC::Action = Function< void()> |
using | SC::native_char_t = char |
The native char for the platform (wchar_t (4 bytes) on Windows, char (1 byte) everywhere else ) More... | |
using | SC::uint8_t = unsigned char |
Platform independent (1) byte unsigned int. More... | |
using | SC::uint16_t = unsigned short |
Platform independent (2) bytes unsigned int. More... | |
using | SC::uint32_t = unsigned int |
Platform independent (4) bytes unsigned int. More... | |
using | SC::uint64_t = unsigned long long |
Platform independent (8) bytes unsigned int. More... | |
using | SC::int8_t = signed char |
Platform independent (1) byte signed int. More... | |
using | SC::int16_t = short |
Platform independent (2) bytes signed int. More... | |
using | SC::int32_t = int |
Platform independent (4) bytes signed int. More... | |
using | SC::int64_t = long long |
Platform independent (8) bytes signed int. More... | |
using | SC::size_t = unsigned long |
Platform independent unsigned size type. More... | |
using | SC::ssize_t = signed long |
Platform independent signed size type. More... | |
Functions | |
template<typename T > | |
constexpr T && | SC::move (T &value) |
Converts an lvalue to an rvalue reference. More... | |
template<typename T > | |
constexpr T && | SC::forward (typename TypeTraits::RemoveReference< T >::type &value) |
Forwards an lvalue or an rvalue as an rvalue reference. More... | |
template<typename T > | |
constexpr T && | SC::forward (typename TypeTraits::RemoveReference< T >::type &&value) |
Forwards an rvalue as an rvalue reference, with a check that it's not an lvalue reference. More... | |
template<typename T > | |
constexpr void | SC::swap (T &t1, T &t2) |
Swaps the values of two objects. More... | |
template<typename F > | |
Deferred< F > | SC::MakeDeferred (F &&f) |
Creates a Deferred object holding a function that will be invoked at end of current scope. More... | |
void * | operator new (SC::size_t, void *p, SC::PlacementNew) noexcept |
Custom placement new using SC::PlacementNew class. More... | |
Language Utilities Utility classes allowing common C++ constructs.
Tag structure for custom placement new.
#define SC_TRUST_RESULT | ( | expression | ) | SC_ASSERT_RELEASE(expression) |
#include <Result.h>
Asserts that the given result is valid.
#define SC_TRY | ( | expression | ) |
#include <Result.h>
Checks the value of the given expression and if failed, returns this value to caller.
#define SC_TRY_MSG | ( | expression, | |
failedMessage | |||
) |
#include <Result.h>
Checks the value of the given expression and if failed, returns a result with failedMessage to caller.
using SC::int16_t = typedef short |
#include <PrimitiveTypes.h>
Platform independent (2) bytes signed int.
using SC::int32_t = typedef int |
#include <PrimitiveTypes.h>
Platform independent (4) bytes signed int.
using SC::int64_t = typedef long long |
#include <PrimitiveTypes.h>
Platform independent (8) bytes signed int.
using SC::int8_t = typedef signed char |
#include <PrimitiveTypes.h>
Platform independent (1) byte signed int.
using SC::native_char_t = typedef char |
#include <PrimitiveTypes.h>
The native char for the platform (wchar_t (4 bytes) on Windows, char (1 byte) everywhere else )
using SC::size_t = typedef unsigned long |
#include <PrimitiveTypes.h>
Platform independent unsigned size type.
using SC::ssize_t = typedef signed long |
#include <PrimitiveTypes.h>
Platform independent signed size type.
using SC::uint16_t = typedef unsigned short |
#include <PrimitiveTypes.h>
Platform independent (2) bytes unsigned int.
using SC::uint32_t = typedef unsigned int |
#include <PrimitiveTypes.h>
Platform independent (4) bytes unsigned int.
using SC::uint64_t = typedef unsigned long long |
#include <PrimitiveTypes.h>
Platform independent (8) bytes unsigned int.
using SC::uint8_t = typedef unsigned char |
#include <PrimitiveTypes.h>
Platform independent (1) byte unsigned int.
|
constexpr |
#include <Compiler.h>
Forwards an rvalue as an rvalue reference, with a check that it's not an lvalue reference.
|
constexpr |
#include <Compiler.h>
Forwards an lvalue or an rvalue as an rvalue reference.
Deferred< F > SC::MakeDeferred | ( | F && | f | ) |
#include <Deferred.h>
Creates a Deferred object holding a function that will be invoked at end of current scope.
f | The lambda to be invoked at end of current scope |
|
constexpr |
#include <Compiler.h>
Converts an lvalue to an rvalue reference.
|
inlinenoexcept |
#include <PrimitiveTypes.h>
Custom placement new using SC::PlacementNew class.
|
inlineconstexpr |
#include <Compiler.h>
Swaps the values of two objects.