Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. #313 Given the following in C++

#313 Given the following in C++

Scheduled Pinned Locked Moved Uncategorized
cpluspluscpppolls
2 Posts 2 Posters 4 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • shafik@hachyderm.ioS This user is from outside of this forum
    shafik@hachyderm.ioS This user is from outside of this forum
    shafik@hachyderm.io
    wrote last edited by
    #1

    #313 Given the following in C++

    static union {
    int x;
    }; // Well-formed?

    Without checking:

    A. Yes
    B. No

    #Cplusplus
    #Cpppolls

    charette@mstdn.caC 1 Reply Last reply
    1
    0
    • shafik@hachyderm.ioS shafik@hachyderm.io

      #313 Given the following in C++

      static union {
      int x;
      }; // Well-formed?

      Without checking:

      A. Yes
      B. No

      #Cplusplus
      #Cpppolls

      charette@mstdn.caC This user is from outside of this forum
      charette@mstdn.caC This user is from outside of this forum
      charette@mstdn.ca
      wrote last edited by
      #2

      @shafik Are we worried about having a union with a single member? Or is there something else I missed?

      Had to look it up. Single-member unions are perfectly legal.

      What I didn't know is unions can also have methods, including constructors.

      1 Reply Last reply
      1
      0
      • R relay@relay.mycrowd.ca shared this topic
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups