fixedstring: a @safe, @nogc string type

Moth postmaster at gmail.com
Mon Jan 10 18:30:50 UTC 2022


On Monday, 10 January 2022 at 14:06:27 UTC, Moth wrote:
> On Monday, 10 January 2022 at 13:12:13 UTC, jmh530 wrote:
>
>> You might add some examples to the Readme.md
>
> good observation, i'll work on that. in the meantime the 
> examples in the unittests should suffice.

fixed.

for those who don't want to visit the github just to see the 
change, here's the example code:
```d
void main() @safe @nogc nothrow
{
	FixedString!14 foo = "clang";
	foo[0] = 'd';
	foo ~= " is cool";
	assert (foo == "dlang is cool");

	foo.length = 9;

	auto bar = FixedString!4("neat");
	assert (foo ~ bar == "dlang is neat");
}
```



More information about the Digitalmars-d-announce mailing list