D 1.0   D 2.0
About Japanese Translation

Last update Tue Oct 16 09:58:56 2007

std.metastrings

文字列をコンパイル時に操作するテンプレート

template Format(A...)
定数をコンパイル時に文字列へと整形する。 std.string.format() のコンパイル時バージョン。

Parameters:
A = 定数のタプル。文字列、 文字、整数のいずれか。

Formats:
対応しているフォーマットは、 引数を文字列化する %s と、% という文字自体を出力する %% です。

Example:
import std.metastrings;
import std.stdio;

void main()
{
  string s = Format!("Arg %s = %s", "foo", 27);
  writefln(s); // "Arg foo = 27"
}


template ToString(ulong U)
template ToString(long I)
template ToString(uint U)
template ToString(int I)
template ToString(ushort U)
template ToString(short I)
template ToString(ubyte U)
template ToString(byte I)
template ToString(bool B)
template ToString(string S)
template ToString(char C)
定数引数を文字列に変換

template ParseUinteger(string s)
符号なし整数リテラルを、文字列 s の先頭から切り出します

Returns:
.value = 整数リテラルを文字列化したもの .rest = 整数リテラルをとった残りの文字列

Otherwise:
.value = null, .rest = s

template ParseInteger(string s)
先頭に '-' がついているかもしれない整数リテラルを、 文字列 s の先頭から切り出します

Returns:
.value = 整数リテラルを文字列化したもの .rest = 整数リテラルをとった残りの文字列

Otherwise:
.value = null, .rest = s