Re: C question for you old guys ;-)
Re: C question for you old guys ;-)
- Subject: Re: C question for you old guys ;-)
- From: Alex Curylo <email@hidden>
- Date: Thu, 12 Jun 2003 09:01:33 -0700
on 6/11/03 8:10 PM, email@hidden at
email@hidden wrote:
>
And since not_eq and or_eq are also defined, it would be more
>
consistent to
>
#define eq ==
This would also break standard C++. Observe in <string>
template<class charT>
struct char_traits
{
...
static bool eq(const char_type& c1, const char_type& c2);
Personally, if I really must resort to using a #define for something I
generally name it with all uppercase, which
a) makes it reasonably obvious it's a #define to most people
b) conflicts with no standard C or derivative language constructs
c) has an acceptably low probability of conflicting with other code.
For instance, in the particular case under discussion,
#define I_AM_TOO_STUPID_TO_READ_WARNINGS_SO_I_TEST_EQUALITY_WITH_THIS ==
would serve to make it perfectly clear to any reader at all exactly what is
going on, and conflicts with nothing that conceivably exists now or in the
foreseeable future, I'd say.
--
Alex Curylo -- email@hidden --
http://www.alexcurylo.com/
"You are so in touch with your inner ego ... I like that in a man."
-- Nancy Schoening
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.