Zero-cost version-dependent function call at -O0.

Johan Engelen via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 25 14:58:36 PDT 2017


On Sunday, 25 June 2017 at 16:29:20 UTC, Anonymouse wrote:
>
> Am I missing something, or can't you just version both the 
> function and the function ćall?
>
> version(X)
> void foo() { /* ... */ }
>
> void main()
> {
>     version(X)
>     {
>         foo();
>     }
> }

I am hoping for something where "foo()" would just work.
"version(X) foo();" isn't bad, but it adds a lot of noise.

-Johan


More information about the Digitalmars-d-learn mailing list