Dicebot:
Benefits: no arbitrary message length limit, no string
construction unless toString is actually called.
A nothrow @nogc function like the bufferText I've suggested is
also useful in situations like this (currently this can't
compile):
struct Foo {
int[3] data;
ref int
29-May-2014 03:52, Dicebot пишет:
On Wednesday, 28 May 2014 at 23:27:34 UTC, bearophile wrote:
This is currently accepted code:
[]
IMHO something like this is better:
class MyException : Exception
{
private char[20] index_buff; // should be enough for size_t.max
Why not just save
On Thursday, 29 May 2014 at 18:30:28 UTC, Dmitry Olshansky wrote:
29-May-2014 03:52, Dicebot пишет:
On Wednesday, 28 May 2014 at 23:27:34 UTC, bearophile wrote:
This is currently accepted code:
[]
IMHO something like this is better:
class MyException : Exception
{
private char[20]
This is currently accepted code:
void main() {
import std.array: appender;
import std.format: formattedWrite;
auto writer = appender!string;
formattedWrite(writer, %s is the ultimate %s., 42,
answer);
assert(writer.data == 42 is the ultimate answer.);
}
But there are
On Wednesday, 28 May 2014 at 23:27:34 UTC, bearophile wrote:
This is currently accepted code:
void main() {
import std.array: appender;
import std.format: formattedWrite;
auto writer = appender!string;
formattedWrite(writer, %s is the ultimate %s., 42,
answer);