On 10 October 2012 16:45, Paulo Pinto <pjmlp@progtools.org> wrote:

This only works if it is part of the language definition.

In C and C++ case I am usually against it, because I favour portability over dependencies to a specific compiler vendor. Many years of writing multi-platform code do leave some scars.

Errr, what? This enhanced portability, that's the point.
I've spent my career writing more cross-platform code than most coders would touch in their lives, and I give thanks for the platforms where it is available.
It always leads to a vastly simplified path in the build scripts for those platforms that support it, and typically produces more reliable and less fickle results; ie, I never experience link problems with those platforms.

Multi-platform code always has #ifdef guards around #pragma comment(lib,)-ing the appropriate libs for the platform which the code is being built for, and that is the whole point. The code its self selects the libs it depends on by simply being compiled.


As for D, if this can be made part of the language then I see no big reason against it.

Well, DMD says it is ;) .. Question is, is it technically possible for other compilers to support it?