Topic: I bang my static drum


Author: michaelsafyan@aim.com (Michael Aaron Safyan)
Date: Sun, 16 Dec 2007 06:39:23 GMT
Raw View
mbersohn@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.

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





Author: "maninalift@googlemail.com" <maninalift@googlemail.com>
Date: Tue, 11 Dec 2007 09:58:58 CST
Raw View
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-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]





Author: mbersohn@gmail.com
Date: Fri, 14 Dec 2007 17:12:35 CST
Raw View
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
> 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                     ]

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

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