d_time and writefln
Carlos Santander
csantander619 at gmail.com
Tue May 9 07:47:59 PDT 2006
Stewart Gordon escribió:
> Chris Nicholson-Sauls wrote:
> <snip>
>> The problem is, that 'd_time' is just an alias of long, so writef*()
>> just sees it as a long. Maybe d_time could be typedef'd to change
>> this, but would that break anything? If it has no or few cons against
>> it, I'm cool with typedef'ing it, although it would couple std.format
>> and std.date to each other a little.
Another solution would be to add a bit of type information to aliases. In any
case, if d_time is the official way to deal with dates and times in D, I
wouldn't be surprised if many people new to D tried to do
writefln(getUTCtime());
So, regardless of the solution, I believe printing the numeric representation is
wrong.
>
> If we have this, then we ought to have a way for the programmer to
> define a custom formatting for any typedef.
>
There should be a way to do this, too.
> Stewart.
>
--
Carlos Santander Bernal
More information about the Digitalmars-d-bugs
mailing list