Thread overview
inout and variadic functions
Dec 20, 2004
Tyro
Dec 20, 2004
Russ Lewis
Dec 20, 2004
Tyro
Dec 22, 2004
Simon Buchan
December 20, 2004
Is there anything fundamentally wrong with a variadic function parameters being defined as such:

void foo(inout ...){}

If so, please explain why. Otherwise please add this feature.

Thanks,
Andrew


December 20, 2004
Tyro wrote:
> Is there anything fundamentally wrong with a variadic function parameters being
> defined as such:
> 
> void foo(inout ...){}

This might be an interesting way to implement a scanf alternative. Although with something like scanf, 'out' might make more sense than 'inout'.

December 20, 2004
In article <cq777v$nmp$1@digitaldaemon.com>, Russ Lewis says...
>
>Tyro wrote:
>> Is there anything fundamentally wrong with a variadic function parameters being defined as such:
>> 
>> void foo(inout ...){}
>
>This might be an interesting way to implement a scanf alternative. Although with something like scanf, 'out' might make more sense than 'inout'.
>

This is precisely my reason for asking! Though out is better for scanf(), I think both out and inout should be authorized for use in this manner.


December 22, 2004
On Mon, 20 Dec 2004 18:28:58 +0000 (UTC), Tyro <Tyro_member@pathlink.com> wrote:

> Is there anything fundamentally wrong with a variadic function parameters being
> defined as such:
>
> void foo(inout ...){}
>
> If so, please explain why. Otherwise please add this feature.
>
> Thanks,
> Andrew
>
>

I would rather have a little more contol in general on these functions, things
like foo(bar ree, out uint outArgs..., in uint inArgs...) {} would be nice,
(although I can't think of an explicit exapmle where you want this checked at
compile-time) but I wonder what the syntax would be like? inArgs.ptr?
outArgs[4].typeid? Could be interesting to discuss, at least.

-- 
"Unhappy Microsoft customers have a funny way of becoming Linux,
Salesforce.com and Oracle customers." - www.microsoft-watch.com:
"The Year in Review: Microsoft Opens Up"
--
"I plan on at least one critical patch every month, and I haven't been disappointed."
- Adam Hansen, manager of security at Sonnenschein Nath & Rosenthal LLP
(Quote from http://www.eweek.com/article2/0,1759,1736104,00.asp)
--
"It's been a challenge to "reteach or retrain" Web users to pay for content, said Pizey"
-Wired website: "The Incredible Shrinking Comic"