Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.std.c++ > #597

C++11 – Enumeration Aliasing

Message-ID <f29c62f3-e2a4-4a58-9007-39fce9ee6f32@googlegroups.com> (permalink)
Newsgroups comp.std.c++
From molw5.iwg@googlemail.com
Subject C++11 – Enumeration Aliasing
Organization unknown
Date 2013-02-25 11:00 -0600

Show all headers | View raw


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


-- 
[ comp.std.c++ is moderated.  To submit articles, try posting with your ]
[ newsreader.  If that fails, use mailto:std-cpp-submit@vandevoorde.com ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]

Back to comp.std.c++ | Previous | Next | Find similar


Thread

C++11 – Enumeration Aliasing molw5.iwg@googlemail.com - 2013-02-25 11:00 -0600

csiph-web