Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
C is a general-purpose computer programming language used for operating systems, games and other high performance work.
1
vote
Is it always safe to shift bool values?
C++14 and C++ 4.9.2:
v = 1
b2i(v) = 2
b2i(v) = 2
C++ 4.3.2 (also in Borland 0x0564):
v = 1
b2i(v) = 2
b2i(v) = 510 …
3
votes
2
answers
5k
views
Is it always safe to shift bool values?
errorneous)
{
return
(finished & 1) |
((code & 0xffff)<<1) |
((err & 1)<< 17);
}
I'm not sure if this code (style) reaches back into times where bool wasn't available in C. …