Language Utilities Utility classes allowing common C++ constructs. More...
Classes | |
| struct | SC::StrongID< TagType, IDType, InvalidValue > |
| Strongly typed ID (cannot be assigned incorrectly to another ID) More... | |
| 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::OpaqueObject< Definition > |
| Hides implementation details from public headers (static PIMPL). More... | |
| struct | SC::TimeMs |
| A vocabulary type representing a time interval in milliseconds since epoch. 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::UniqueHandle< Definition > |
| Move only handle that has a special tag value flagging its invalid state. More... | |
| struct | SC::MaxValue |
| An object that can be converted to any primitive type providing its max value. More... | |
Macros | |
| #define | SC_TRY(expression) |
| Checks the value of the given expression and if failed, returns this value to caller. | |
| #define | SC_TRY_MSG(expression, failedMessage) |
| Checks the value of the given expression and if failed, returns a result with failedMessage to caller. | |
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 ) | |
| using | SC::uint8_t = unsigned char |
| Platform independent (1) byte unsigned int. | |
| using | SC::uint16_t = unsigned short |
| Platform independent (2) bytes unsigned int. | |
| using | SC::uint32_t = unsigned int |
| Platform independent (4) bytes unsigned int. | |
| using | SC::uint64_t = unsigned long long |
| Platform independent (8) bytes unsigned int. | |
| using | SC::int8_t = signed char |
| Platform independent (1) byte signed int. | |
| using | SC::int16_t = short |
| Platform independent (2) bytes signed int. | |
| using | SC::int32_t = int |
| Platform independent (4) bytes signed int. | |
| using | SC::int64_t = long long |
| Platform independent (8) bytes signed int. | |
| using | SC::size_t = unsigned long |
| Platform independent unsigned size type. | |
| using | SC::ssize_t = signed long |
| Platform independent signed size type. | |
Functions | |
| template<typename T > | |
| constexpr T && | SC::move (T &value) |
| Converts an lvalue to an rvalue reference. | |
| template<typename T > | |
| constexpr T && | SC::forward (typename TypeTraits::RemoveReference< T >::type &value) |
| Forwards an lvalue or an rvalue as an rvalue reference. | |
| 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. | |
| template<typename T > | |
| constexpr void | SC::swap (T &t1, T &t2) |
| Swaps the values of two objects. | |
| 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. | |
| void * | operator new (SC::size_t, void *p, SC::PlacementNew) noexcept |
| Custom placement new using SC::PlacementNew class. | |
| void * | operator new[] (SC::size_t, void *p, SC::PlacementNew) noexcept |
Language Utilities Utility classes allowing common C++ constructs.
Tag structure for custom placement new
| #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 = short |
#include <PrimitiveTypes.h>
Platform independent (2) bytes signed int.
| using SC::int32_t = int |
#include <PrimitiveTypes.h>
Platform independent (4) bytes signed int.
| using SC::int64_t = long long |
#include <PrimitiveTypes.h>
Platform independent (8) bytes signed int.
| using SC::int8_t = signed char |
#include <PrimitiveTypes.h>
Platform independent (1) byte signed int.
| using SC::native_char_t = 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 = unsigned long |
#include <PrimitiveTypes.h>
Platform independent unsigned size type.
| using SC::ssize_t = signed long |
#include <PrimitiveTypes.h>
Platform independent signed size type.
| using SC::uint16_t = unsigned short |
#include <PrimitiveTypes.h>
Platform independent (2) bytes unsigned int.
| using SC::uint32_t = unsigned int |
#include <PrimitiveTypes.h>
Platform independent (4) bytes unsigned int.
| using SC::uint64_t = unsigned long long |
#include <PrimitiveTypes.h>
Platform independent (8) bytes unsigned int.
| using SC::uint8_t = 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.