Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++11 Enumeration Aliasing

Reply
Thread Tools

C++11 Enumeration Aliasing

 
 
molw5.iwg@gmail.com
Guest
Posts: n/a
 
      02-24-2013
Recently I've been using C++11 enumerations to provide a byte pointer with
stronger strict-aliasing properties. Specifically, I've been using the
definition:

enum byte : uint8_t {};

My reading of the strict-aliasing rules supports the behaviour modern compilers
exhibit in this regard; specifically, byte* aliases only other byte pointers and
raw character points. I'm looking for a second opinion here with respect to the
strict-aliasing rules additionally, I'd like to know if I'm implicitly relying
on any undefined or implementation-specific behaviour here I may have overlooked.
Thanks in advance,

-molw5
 
Reply With Quote
 
 
 
 
molw5.iwg@gmail.com
Guest
Posts: n/a
 
      02-24-2013
On Sunday, February 24, 2013 11:10:07 AM UTC-7, (E-Mail Removed) wrote:
> Recently I've been using C++11 enumerations to provide a byte pointer with
>
> stronger strict-aliasing properties. Specifically, I've been using the
>
> definition:
>
>
>
> enum byte : uint8_t {};
>
>
>
> My reading of the strict-aliasing rules supports the behaviour modern compilers
>
> exhibit in this regard; specifically, byte* aliases only other byte pointers and
>
> raw character points. I'm looking for a second opinion here with respectto the
>
> strict-aliasing rules additionally, I'd like to know if I'm implicitly relying
>
> on any undefined or implementation-specific behaviour here I may have overlooked.
>
> Thanks in advance,
>
>
>
> -molw5


Wrong forum, apologies
 
Reply With Quote
 
 
 
 
red floyd
Guest
Posts: n/a
 
      02-25-2013
On 2/24/2013 10:10 AM, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> On Sunday, February 24, 2013 11:10:07 AM UTC-7, (E-Mail Removed) wrote:
>>[redacted]

>
> Wrong forum, apologies
>

Actually, it's perfectly legit here. I suspect you will get a
good answer.


 
Reply With Quote
 
molw5.iwg@gmail.com
Guest
Posts: n/a
 
      02-25-2013
On Sunday, February 24, 2013 9:08:06 PM UTC-7, red floyd wrote:
> Actually, it's perfectly legit here. I suspect you will get a
>
> good answer.


It's already up in "Aliasing in C++11" (effectively); re-post.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling a listbox with the values in a enumeration Timothy Parez ASP .Net 3 06-29-2010 05:59 AM
Re-using a simple type definition; with enumeration constraint andwithout enumeration constraint puvit82 XML 4 02-01-2008 03:46 PM
enumeration types Charlie VHDL 4 02-09-2005 03:01 PM
Visibility of enumeration literals under use clauses biau@altavista.com VHDL 15 02-01-2005 04:19 AM
Record, Enumeration & std_logic_vector Jan Kindt VHDL 5 09-12-2003 10:25 AM



Advertisments