View Poll Results: Do you use 'and' 'or' 'xor' in place of && || ^
- Voters
- 20. You may not vote on this poll
-
October 28th, 2009, 05:47 AM
#1
Do you use 'and' 'or' 'xor'?
Here's a poll inspired from a recent post.
Do you use 'and' 'or' 'xor' in place of && || ^
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
-
October 28th, 2009, 05:59 AM
#2
Re: Do you use 'and' 'or' 'xor'?
not used
sorry, I meant: !used
-
October 28th, 2009, 06:15 AM
#3
Re: Do you use 'and' 'or' 'xor'?
- Guido
-
October 28th, 2009, 06:27 AM
#4
Re: Do you use 'and' 'or' 'xor'?
No.
I guess VB programming learning C++ may use this.
-
October 28th, 2009, 07:50 AM
#5
Re: Do you use 'and' 'or' 'xor'?
Originally Posted by JohnW@Wessex
Do you use 'and' 'or' 'xor' in place of && || ^
What do you mean by this? Is this some non-standard feature supported by some compiler?
-
October 28th, 2009, 08:02 AM
#6
Re: Do you use 'and' 'or' 'xor'?
Originally Posted by nuzzle
What do you mean by this? Is this some non-standard feature supported by some compiler?
JohnW@Wessex is talking about certain alternative tokens that are supported by any standard compliant C++ compiler and available via <iso646.h> from the C standard library (it might be a C99 only header though).
-
October 28th, 2009, 08:03 AM
#7
Re: Do you use 'and' 'or' 'xor'?
They're part of the standard, but Visual Studio, for example, needs a compiler switch to enable them, as they can break older code.
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
-
October 28th, 2009, 08:05 AM
#8
Re: Do you use 'and' 'or' 'xor'?
The set of alternatives are...
Code:
<% {
%> }
<: [
:> ]
%: #
%:%: ##
and &&
bitor |
or ||
xor ^
compl ~
bitand &
and_eq &=
or_eq |=
xor_eq ^=
not !
not_eq !=
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
-
October 28th, 2009, 08:09 AM
#9
Re: Do you use 'and' 'or' 'xor'?
Originally Posted by JohnW@Wessex
The set of alternatives are...
I note that the first six (the digraphs) should be available by default for C (at least for C99) as well, without needing to include <iso646.h>.
-
October 28th, 2009, 08:48 AM
#10
Re: Do you use 'and' 'or' 'xor'?
I had no idea about this.
I'm using VS 2008 and these additional keywords aren't recognized by the compiler. It works if I include <iso646.h> though.
Is there some property setting I can use that enables VS 2008 to recognize and highlight those keywords? I've looked but I cannot find anything.
-
October 28th, 2009, 08:59 AM
#11
Re: Do you use 'and' 'or' 'xor'?
Originally Posted by nuzzle
I'm using VS 2008 and these additional keywords aren't recognized by the compiler.
I tried disabling language extensions and they worked.
Originally Posted by nuzzle
It works if I include <iso646.h> though.
<ciso646> for MSVC9 seems to mainly include <iso646.h>. Its <iso646.h> appears to conditionally define those macros if language extensions are enabled, so perhaps there is no more specific compiler switch than disabling language extensions to enable this without including a header.
-
October 28th, 2009, 09:02 AM
#12
Re: Do you use 'and' 'or' 'xor'?
I may be wrong about the compiler switch
I'm sure I saw mention of it when I copied the list from a web page I found, but I can't find it now.
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
-
October 28th, 2009, 10:23 AM
#13
Re: Do you use 'and' 'or' 'xor'?
Originally Posted by Alex F
No.
I guess VB programming learning C++ may use this.
I started life as a VB programmer but prefer using the {|, &&, ^} operators. It is easier to distinguish between operators and operands at a glance.
Rich
Visual Studio 2010 Professional | Windows 7 (x64)
Ubuntu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|