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 8833741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:51:10+00:00 2026-06-14T08:51:10+00:00

The C++ standards mentions that reinterpret_cast is implementation defined, and doesn’t give any guarantees

  • 0

The C++ standards mentions that reinterpret_cast is implementation defined, and doesn’t give any guarantees except that casting back (using reinterpret_cast) to original type will result in original value passed to first.

C-style casting of at least some types behaves much the same way – casting back and forth results with the same value – Currently I am working with enumerations and ints, but there are some other examples as well.

While C++ standard gives those definitions for both cast-styles, does it also give the same guarantee for mixed casts? If library X returns from function int Y() some enum value, can use any of above casts, without worrying what cast was used to convert initial enum to int in Y’s body? I don’t have X’s source code, so I cannot check (and it can change with next version anyway), and things like that are hardly mentioned in documentation.

I know that under most implementations in such cases both casts behave the same; my question is: what does C++ standard say about such cases – if anything at all.

  • 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-14T08:51:12+00:00Added an answer on June 14, 2026 at 8:51 am

    C++ defines the semantic of the C cast syntax in terms of static_cast, const_cast and reinterpret_cast. So you get the same guaranteed for the same operation whatever syntax you use to achieve it.

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

Sidebar

Related Questions

Are standards like ISO 9241 Ergonomics of Human System Interaction of any relevance in
Are there some standards that you consider to be so obvious that they would
according to the HTML Standards ID-Attributes of any HTML Tag in a webpage have
I know that there are so many standards for writing code. And some policy
I'm working on a project that will generate an OAuth querystring in JavaScript, using
The Zend Framework coding standard mentions the following: For files that contain only PHP
I've run into a problem that seems to not be addressed by any of
How do I declare a function pointer that can safely point to any function?
I'm writing standards compliant XHTML Strict 1.0, so including the HTML target attribute on
According to W3C standards, if you have a nillable element with a nil value,

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.