FixedString

Constructors

this
this(CharT[] rhs)

constructor

Members

Functions

concat
auto concat(T rhs)

concatenation. note that you should probably use the ~ operator instead - only use this version when you are pressed for ram and aren't making many calls, or you will end up with template bloat.

empty
bool empty()
front
CharT front()

range interface

length
size_t length()
void length(size_t rhs)
opAssign
void opAssign(CharT[] rhs)
void opAssign(T rhs)

assignment

opBinary
auto opBinary(T rhs)

concatenation operator. generally, you should prefer this version.

opDollar
size_t opDollar()

array features...

opEquals
bool opEquals(T rhs)
bool opEquals(CharT[] s)

equality

opIndex
const(CharT)[] opIndex()
CharT opIndex(size_t index)
opIndexAssign
void opIndexAssign(CharT rhs, size_t index)

array features...

opOpAssign
void opOpAssign(CharT[] rhs)
void opOpAssign(CharT rhs)
void opOpAssign(T rhs)

assignment

opSlice
auto opSlice(size_t first, size_t last)

array features...

popFront
void popFront()

range interface

toHash
size_t toHash()
toString
const(CharT)[] toString()

Manifest constants

size
enum size;

Examples

readme example code

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);

Meta