Why is std.string.format a c-style variadic function?

Jacob Carlborg doob at me.com
Mon Sep 26 09:11:04 PDT 2011


On 2011-09-26 17:12, Steven Schveighoffer wrote:
> On Mon, 26 Sep 2011 08:42:09 -0400, Andrej Mitrovic
> <andrej.mitrovich at gmail.com> wrote:
>
>> On 9/26/11, Jacob Carlborg <doob at me.com> wrote:
>>> std.string.format is using a D-style variadic parameter list.
>>
>> The compiler disagrees with you:
>>
>> D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\string.d(2432): Error:
>> function std.string.format C-style variadic functions are not yet
>> implemented in CTFE
>>
>> L2432:
>> string format(...)
>>
>> I don't see any other format() overloads in std.string.
>
> That's likely a bug. D variadic functions push the TypeInfo of each
> parameter onto the stack as well as the parameters themselves.
>
> Unfortunately, it's probably just a wrong error message, I doubt D
> variadic parameters are supported in CTFE.
>
> -Steve

Yes, that is not a C-style variadic function.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list