C++ Logo

sg12

Advanced search

Re: [ub] ub due to left operand of shift

From: Lawrence Crowl <Lawrence_at_[hidden]>
Date: Wed, 30 Oct 2013 22:22:29 -0700
On 10/30/13, John Regehr <regehr_at_[hidden]> wrote:
>> void print_type( int arg )
>> { std::cout << "unsigned" << std::endl; }
>> void print_type( unsigned int arg )
>> { std::cout << "signed" << std::endl; }
>
> Wait a sec, each of these is printing the opposite of what it's supposed
> to print, right?

Oh, sorry, transcription error. At any event, in in my mind, the unexpected
thing happens. (Unexpected from the user view, not from the standards view.)

-- 
Lawrence Crowl

Received on 2013-10-31 06:22:31