www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/10/18/15:49:36

From: jeremy AT jdyallop DOT freeserve DOT co DOT uk (Jeremy Yallop)
Newsgroups: comp.lang.c++,comp.os.msdos.djgpp
Subject: Re: Making C++ little easier to beginners...
References: <9qmkrh$581$1 AT tron DOT sci DOT fi>
Message-ID: <slrn9su9tc.cnp.jeremy@chopin.toad.co.uk>
Mime-Version: 1.0
User-Agent: slrn/0.9.6.3 (Linux)
Lines: 44
Date: Thu, 18 Oct 2001 19:33:18 GMT
NNTP-Posting-Host: 62.253.146.44
X-Complaints-To: abuse AT ntlworld DOT com
X-Trace: news2-win.server.ntlworld.com 1003433598 62.253.146.44 (Thu, 18 Oct 2001 20:33:18 BST)
NNTP-Posting-Date: Thu, 18 Oct 2001 20:33:18 BST
Organization: ntlworld News Service
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Traveler (traveler AT netti DOT fi) wrote in comp.lang.c++:
[...]
>
>wouldn´t this be nicer ?
>
>if(x EQUAL 10 AND y EQUAL 10)

C++ already provides some of what you want.

>#define    AND        &

For this you have bit_and.

>#define    COMPLEMENT    ~

compl

>#define    EQUAL    ==
>#define    EQU        EQUAL
>#define    NOT        !

not

>#define    OR            |

bitor

>#define    XOR        ^

xor

Also provided are:

  not_eq (!=)
  and_eq (&=)
  xor_eq (^=)
  or_eq  (!=)
  or     (||)
  and    (&&)

-- 
   Jeremy Yallop  -  jeremy AT jdyallop DOT freeserve DOT co DOT uk
"Many are the thoughts in a man's heart, but the counsel of
 Jehovah, that doth stand."                 Proverbs 19: 21

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019