Git Product home page Git Product logo

Comments (3)

gsfreema avatar gsfreema commented on May 21, 2024 2

How "standards compliant/cross compiler compatible" does this issue want to go? My understanding that the best way to work across multiple compilers is to not only include the <cstdint> header but also access these types through the std namespace. Code such as the following doesn't do either, but it is technically using the C++ standard typedefs.
https://github.com/Microsoft/calculator/blob/6a1c2e4bbfd81a9018c8b3e39d2d4afef5caf9f2/src/CalcManager/Header%20Files/Number.h#L14

from calculator.

MicrosoftIssueBot avatar MicrosoftIssueBot commented on May 21, 2024

This is your friendly Microsoft Issue Bot. I created this issue automatically as requested by a team member.

from calculator.

Pharap avatar Pharap commented on May 21, 2024

What the standard has to say about this...

C++11 (taken from the n3242 draft):

Except as noted in Clauses 18 through 30 and Annex D, the contents of each header cname shall be the same as that of the corresponding header name.h, as specified in the C standard library (1.2) or the C Unicode TR, as appropriate, as if by inclusion. In the C++ standard library, however, the declarations (except for names which are defined as macros in C) are within namespace scope (3.3.6) of the namespace std. It is unspecified whether these names are first declared within the global namespace scope and are then injected into namespace std by explicit using-declarations (7.3.3).

The C++17 version is pretty much the same, but with updated section, clause and annex numbers/identifiers.

The most important point to take away from this is that "the declarations ... are within namespace scope of the namespace std.".
The standard only specifies that the names must be in the namespace std,
it does not explicitly specify that they should also be in the global namespace.

Furthermore, the "Header synopsis" ([cstdint.syn]) provided by the standard also only specifies the types in the std namespace.
(The only difference between the C++11 and C++17 listing is that C++11 uses typedef and C++17 uses using.)

from calculator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.