Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: ****ft oper...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 7 Topic 9493 of 9807
Post > Topic >>

Re: ****ft operator undefined behavior

by =?ISO-8859-1?Q?Daniel_Kr=FCgler?= <daniel.kruegler@[EMAIL PROTECTED] Apr 13, 2008 at 12:43 AM

On 12 Apr., 20:13, Jack Klein <jackkl...@[EMAIL PROTECTED]
> wrote:
> #include <climits>
> /* include at least one header that defines std::sizeof */
>
> unsigned int safe_uint_****ft(unsigned int value, unsigned int bits)
> {
>     if (bits > (CHAR_BIT * std::sizeof(unsigned int)) return 0;
>     else return value << bits;
> }

Hmmh, there does not exist something like std::sizeof
and no header is required for the usage of the keyword
sizeof. You probably want to say that a header is
required that defined CHAR_BIT?

Greetings from Bremen,

Daniel Krügler



-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 7 Posts in Topic:
shift operator undefined behavior
Olivier Langlois <olan  2008-04-11 15:33:41 
Re: shift operator undefined behavior
Jack Klein <jackklein@  2008-04-12 12:13:12 
Re: shift operator undefined behavior
"Bo Persson" &l  2008-04-13 00:43:14 
Re: shift operator undefined behavior
Olivier Langlois <olan  2008-04-13 00:43:12 
Re: shift operator undefined behavior
=?ISO-8859-1?Q?Daniel_Kr=  2008-04-13 00:43:11 
Re: shift operator undefined behavior
Jack Klein <jackklein@  2008-04-14 10:43:12 
Re: shift operator undefined behavior
Greg Herlihy <greghe@[  2008-04-14 13:13:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 19 20:10:42 CDT 2008.