Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I bang my static drum

0 views
Skip to first unread message

manin...@googlemail.com

unread,
Dec 11, 2007, 10:58:58 AM12/11/07
to
Firstly, an apology. I have made this point in another thread and I
fear I may be banging on but I'd really like to hear some feedback and
I promise this is the last time I post on it.

Static assertions are stated to be a solution to the gap between the
runtime assertions and precompiler assertions neither of which meet
the needs of the template library writer.

Similarly there is a gap between "if" and #if. Much of the obtuse
template trickery that we perform and the obese code we generate from
the precompiler is a result of our inability to include or exclude
code at compile time as simply as using "if".

The D programming language following other languages such as Ada,
contains conditional compilation ("static if") which allows particular
blocks of code to be included or excluded according to conditions
checked at compile time.

I must run now. But the point is. This seems to me a wonderful thing
but is there a reason why it could not be included into C++?

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std...@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

mber...@gmail.com

unread,
Dec 14, 2007, 6:12:35 PM12/14/07
to
On Dec 11, 10:58 am, "maninal...@googlemail.com"
> [ your news-reader. If that fails, use mailto:std-...@ncar.ucar.edu ]

> [ --- Please see the FAQ before posting. --- ]
> [ FAQ:http://www.comeaucomputing.com/csc/faq.html ]

Can't you do that with #ifdef and/or #ifndef?

Michael Aaron Safyan

unread,
Dec 16, 2007, 1:39:23 AM12/16/07
to
mber...@gmail.com wrote:
> On Dec 11, 10:58 am, "maninal...@googlemail.com"
> <maninal...@googlemail.com> wrote:
>> Firstly, an apology. I have made this point in another thread and I
[snipped]

>
> Can't you do that with #ifdef and/or #ifndef?

No. The preprocessor is not able to interact with other C++ code. For
example, the preprocessor cannot evaluate the "sizeof" operator or check
for the existence of various function signatures.

0 new messages