Module ysbase
I often find I need to write the same utilities again and again in my projects, so I have written a library to provide a sane and semi-modular base. Hopefully you find it useful too!
It contains enhanced performant and composable memory allocators, smart pointers and similar configurable-allocator memory utilities (strings w/ SSO, lists, refcount wrappers).
It also includes miscellaneous utilities that I find myself writing a lot, and some template helpers.
Please see the README for more information,
including on what the deal is with all the std
forks, and the build-time configuration
available with this library.
Source Code: ysbase/package.d
Functions
Name | Description |
---|---|
getHashOf(value)
|
Gets the hash code for an object. Calls value if it exists, else uses the class pointer, or hashes the struct value.
If defined, toHash must be const.
|
zcmove(src)
|
move() but just does a copy for copyable types with no overhead.
|
Structs
Name | Description |
---|---|
Unit
|
A singleton type that can be used in place of void , noreturn , or typeof(null) as potential "nothing" types.
|
Templates
Name | Description |
---|---|
transmute
|
Reinterprets the bits of one type as that of another, without calling any constructors or destructors. |
Global variables
Name | Type | Description |
---|---|---|
unit
|
Unit
|
The pre-constructed singleton value of type Unit .
|