mir.parse

@nogc and nothrow Parsing Utilities

Members

Functions

fromString
T fromString(const(C)[] str)

Performs nothrow and @nogc string to native type conversion.

fromString
bool fromString(const(C)[] str, T value)

Performs nothrow and @nogc string to native type conversion.

parse
bool parse(Range r, T value)

Single character parsing utilities.

parse
bool parse(Range r, T value)

Integer parsing utilities.

Examples

mir.conv: to extension.

import mir.conv: to;

assert("123.0".to!double == 123);
assert("123".to!int == 123);
assert("123".to!byte == 123);

import mir.small_string;
alias S = SmallString!32;
assert(S("123.0").to!double == 123);
assert(S("123.").to!double == 123.);
assert(S(".123").to!double == .123);
assert(S("123").to!(immutable int) == 123);

Meta

License

Apache-2.0

Authors

Ilya Yaroshenko