|
From: Jaap de W. <wo...@Ne...> - 2003-02-28 14:30:06
|
This is not really new, you could use it since VC4.2 (Microsoft ~1995)
The only thing was you had to include <iso646.h>:
/* iso646.h standard header */
#ifndef _ISO646
#define _ISO646
#define and &&
#define and_eq &=
#define bitand &
#define bitor |
#define compl ~
#define not !
#define not_eq !=
#define or ||
#define or_eq |=
#define xor ^
#define xor_eq ^=
#endif /* _ISO646 */
/*
* Copyright (c) 1994 by P.J. Plauger. ALL RIGHTS RESERVED.
* Consult your license regarding permissions and restrictions.
*/
The reason for this was that at the moment of talking about a new standard,
there were keyboards with ugly ways to access the ^~| and & key.
(And still at some keyboards you have to look a second time to find the
right key)
Jaap
-----Original Message-----
From: Ioannis Vranos [mailto:no...@ho...]
Sent: Friday, February 28, 2003 11:52 AM
To: Dev-C++ Mailing List
Subject: [Dev-C++] keywords
By the way guys and girls, did you know that in C++98 you can do:
#include <iostream>
int main()
{
int x=1, y=2;
if(x>y or x*y==2)
std::cout<<"Beep beep\n";
y=y bitand x;
x and_eq y;
}
That is to use keywords instead of || etc symbols?
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|