Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9152065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:57:10+00:00 2026-06-17T11:57:10+00:00

All descriptions that I can find talk about pointer to member in the context

  • 0

All descriptions that I can find talk about “pointer to member” in the context of a class. Unions are very similar to structures, and in particular have members too. Can you have a pointer to those members too?

E.g.

union x {
    int a;
    float b;
};
int x::*p = &x::a;

I’m not talking about pointer to the union as a whole, pointers as members of a union, etc. p in the example above would really be an offset, obviously of size 0. I’d need this construct to answer this question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:57:11+00:00Added an answer on June 17, 2026 at 11:57 am

    §3.9.2/1: Compound types can be constructed in the following ways: … pointers to non-static 50 class members, which identify members of a given type within objects of a given class,

    §8.3.3/1: In a declaration T D where D has the form … and the nested-name-specifier denotes a class, …

    §5.3.1/3: The result of the unary & operator is a pointer to its operand. The operand shall be an lvalue or a qualified-id. If the operand is a qualified-id naming a non-static member m of some class C with type T, the result has type “pointer to member of class C of type T” and is a prvalue designating C::m.

    And of course §9.5/5: A union is a class defined with the class-key union…

    (§3.9.2/1 also mentions: unions, which are classes…)

    No mention that the class cannot be a union, so yes, you can form such a PTM type and value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how i can find similar descriptions in excel and replace them
There is a very cool sounding technique called Shape Context matching, which can be
How can i write unit integration tests that talk to a database. e.g.: public
I've heard that you can use Unicode in the descriptions for your app in
I was reviewing some information about the components of the URL, but can't find
Hi all i'm trying to make a MonoDevelop addin that I can use to
All I want to do is return the index of the i that is
All, How can I bind the array of drop down list items returned from
All my files can be found on GitHub: https://github.com/Integralist/Passage (just in case you need
Something is wrong with my binding. But I can't find it I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.