C++11 – Enumeration Aliasing

Discussion in 'C++' started by molw5.iwg@gmail.com, Feb 24, 2013.

  1. Guest

    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
    , Feb 24, 2013
    #1
    1. Advertising

  2. Guest

    On Sunday, February 24, 2013 11:10:07 AM UTC-7, 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 :)
    , Feb 24, 2013
    #2
    1. Advertising

  3. red floyd Guest

    On 2/24/2013 10:10 AM, wrote:
    > On Sunday, February 24, 2013 11:10:07 AM UTC-7, wrote:
    >>[redacted]

    >
    > Wrong forum, apologies :)
    >

    Actually, it's perfectly legit here. I suspect you will get a
    good answer.
    red floyd, Feb 25, 2013
    #3
  4. Guest

    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.
    , Feb 25, 2013
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timothy Parez
    Replies:
    3
    Views:
    3,752
    WhatIThink
    Jun 29, 2010
  2. Jan Kindt
    Replies:
    5
    Views:
    2,014
    Allan Herriman
    Sep 12, 2003
  3. Replies:
    15
    Views:
    1,291
    Jerry Coffin
    Feb 1, 2005
  4. Charlie

    enumeration types

    Charlie, Feb 8, 2005, in forum: VHDL
    Replies:
    4
    Views:
    548
    Charlie
    Feb 9, 2005
  5. puvit82
    Replies:
    4
    Views:
    742
    puvit82
    Feb 1, 2008
Loading...

Share This Page