best replacement for - cout << "hello D" << endl; ?

Bruce Adams tortoise_74 at no.spam.ya.hoo.co.uk
Tue Jul 10 19:31:25 PDT 2007


Hi,
   The biggest single problem with D is that its a very very bad search term for google. I usually add phobos but that doesn't always help.
   I'm trying to find the 'best' replacement for C++ streaming I/O.
I dislike C style format strings because of the type safety issue and run time interpretation issues. I'm pretty sure D works around this using a typeinfo array but I keep losing the function. I understand that writefln is now favoured over printf (http://www.prowiki.org/wiki4d/wiki.cgi?HowTo/printf). I've also seen a dout floating around which isn't quite what I'm hoping for. I thought I saw an article a few years back decrying the operator<< syntax and describing D's replacement.
Can anyone point me in the right direction? This really ought to be in the C++ vs D FAQ (http://www.digitalmars.com/d/faq.html)


Regards,

Bruce.


More information about the Digitalmars-d-learn mailing list