An open API service indexing awesome lists of open source software.

https://github.com/moth-tolias/fixedstring

a safe, nogc-compatible templated array type, originally for strings.
https://github.com/moth-tolias/fixedstring

d dlang nogc

Last synced: 4 months ago
JSON representation

a safe, nogc-compatible templated array type, originally for strings.

Awesome Lists containing this project

README

          

# fixedstring
a templated fixed-length array of `char`s, compatible with `@safe`, `@nogc`, and `nothrow` code.

# example
```d
void main() @safe @nogc nothrow
{
FixedString!14 foo = "clang";
foo[0] = 'd';
foo ~= " is cool";
assert(foo == "dlang is cool");

foo.length = 9;

immutable bar = fixedString!"neat";
assert(foo ~ bar == "dlang is neat");

// wchars and dchars are also supported
assert(FixedString!(5, wchar)("áéíóú") == "áéíóú");

// in fact, any type is:
immutable int[4] intArray = [1, 2, 3, 4];
assert(FixedString!(5, int)(intArray) == intArray);
}
```

read [the documentation](https://fixedstring.dpldocs.info/fixedstring.html) for more info!

# licence
AGPL-3.0 or later