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++ > Why do they cas...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 10 Topic 44216 of 48022
Post > Topic >>

Why do they cast it twice?

by ManicQin <ManicQin@[EMAIL PROTECTED] > Mar 30, 2008 at 01:06 AM

Hi, I've browsed the STL code a bit and stumble upon the next line (in
the operator << overload of both long and short outputs - the line is
for checking does the input is a manipulator)

long _Tmp = (_Bfl == ios_base::oct || _Bfl == ios_base::hex)
				? (long)(unsigned short)_Val //<-This Line
                                 : (long)_Val;

Is there any profound reason why they "Double" casting the _Val?
Thanks.
 




 10 Posts in Topic:
Why do they cast it twice?
ManicQin <ManicQin@[EM  2008-03-30 01:06:45 
Re: Why do they cast it twice?
James Kanze <james.kan  2008-03-30 03:46:36 
Re: Why do they cast it twice?
"Bo Persson" &l  2008-03-30 13:21:09 
Re: Why do they cast it twice?
ManicQin <ManicQin@[EM  2008-03-30 04:32:18 
Re: Why do they cast it twice?
"Bo Persson" &l  2008-03-30 13:41:36 
Re: Why do they cast it twice?
Juha Nieminen <nospam@  2008-03-30 16:43:12 
Re: Why do they cast it twice?
"Daniel T." <  2008-03-30 13:06:34 
Re: Why do they cast it twice?
ManicQin <ManicQin@[EM  2008-03-31 00:53:40 
Re: Why do they cast it twice?
tommy.hinks@[EMAIL PROTEC  2008-03-31 13:50:02 
Re: Why do they cast it twice?
Triple-DES <DenPlettfr  2008-03-31 23:33:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Tue Oct 14 11:26:30 CDT 2008.