-1

Do the conventions in a programming language such as in C++ (such as extraction operator >> ) can be changed by a developer? Or is it restricted?

Xaibu Gemi
  • 41
  • 1
  • 4
  • You can write a preprocessor, or your own compiler, or just override the `>>` operator. To answer your title question, there is a committee that proposes and votes on language standards. – 3Dave Feb 13 '18 at 21:37
  • [Where do I find the current C or C++ standard documents?](https://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents) – David C. Rankin Feb 13 '18 at 21:38
  • @DavidLively - What write your own compiler etc.? So nobody else can understand or write the code..... – Ed Heal Feb 13 '18 at 21:39
  • 1
    If you want to change the behavior of the C++ standard language, you are welcome to submit a proposal to the C++ committee for review. – Thomas Matthews Feb 13 '18 at 21:53

1 Answers1

7

You're asking two questions here.

  1. Who makes the C++ Standard?

    The C++ Standards Committee

  2. Can I change the behavior of an operator such as operator>>?

    Yes, you can, via a capability defined in the standard. See:

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
  • So, if that committee brings some new changes to the standards, would every complier maker for that language have to introduce those changes to their compilers? – Xaibu Gemi Feb 13 '18 at 21:40
  • @XaibuGemi They will *if* they want to be compatible with the new version of the language. C++ is modified and published in discrete versions every few years. The current model seems to be based on a release every 3 year. – François Andrieux Feb 13 '18 at 21:43
  • @XaibuGemi: "Have to" isn't the way to phrase it. It's a combination that a portion of consumers will want compilers compliant to specific standards or other specific features, and the product owners will be motivated to be relevant to their consumers. – Matthew Wetmore Feb 13 '18 at 21:44
  • 2
    @XaibuGemi: There's no law specifying that compiler vendors have to implement every new change within 180 days of release, or anything like that. Nonetheless, the main C++ compilers (gcc, clang and to a lesser degree MS VC++) often implement new features even before the committee has finalized the standard to require them. – Jerry Coffin Feb 13 '18 at 21:44
  • Yes, if the changes are part of the standard and the compiler maker wants to represent a "Standards Compliant Compiler", The do not have to implement proposed "extensions" to the standard. – David C. Rankin Feb 13 '18 at 21:44
  • 1
    @Xaibu - You should note that all the major "compiler makers" are members of the committee, so it is not that any new designs are added as a surprise or against everyone's will. The idea is to agree on how to make the language work the same for all compilers. Doing so benefits everyone. – Bo Persson Feb 13 '18 at 23:53