Re: Why We Use C Than C++...



Richard Heathfield <invalid@xxxxxxxxxxxxxxx> writes:

> > Ok, and then write me a working equivalent to the C++ template
> > mechanism... ;o)
>
> Why bother?

To spare a few hundred lines of code?

Ok, I used macros with type arguments to this end before. But I
tended to be yelled at on code reviews for this. I still have no idea
why ... :-)

ImRe
.



Relevant Pages

  • Re: inline vs macro
    ... Richard Heathfield wrote: ... So you're saying macros can't be used safely because you can pass them ... can't be used safely because it is possible to pass stupid arguments to ... It has no safe use. ...
    (comp.lang.c)
  • Re: inline vs macro
    ... Richard Heathfield wrote: ... Superior in every way that I can imagine. ... At the end, biggest is 4, bar is 4, and ... In each case for those samples provided the macros did something odd. ...
    (comp.lang.c)
  • Re: Problem of finding funtion names in any C file
    ... of characters and numbers starting from a character), ... Don't bother with the macro sweep. ... functional macros. ... "If you want to post a followup via groups.google.com, ...
    (comp.lang.c)
  • Re: inline vs macro
    ... Richard Heathfield wrote: ... So you're saying macros can't be used safely because you can pass them ... able to find out - is part of being a programmer. ... It has no safe use. ...
    (comp.lang.c)
  • Re: why is arithmetic on (void*) so scary?
    ... so i've adjusted the macros i showed ... intptr_t and back to void*, ... I wouldn't bother having two different versions of the code. ... doesn't matter here whether you use char or unsigned char.) ...
    (comp.lang.c)