0

How could I request a C++ feature ? Who do I have to write to ?

The feature I would like to request is a mere syntax commodity : When using composition, we need a better syntax in order to provide method forwarding.

Something like what follows :

class Object{
    InnerObject* inner;
public:
    using inner->method; //<-- here
};

Such a feature would entice people to use composition instead of inheritance for object reuse.

Note : For instance, this can be simulated through the use of MACROS, as shown here { Method forwarding with composition instead of inheritance (using C++ traits)}.

Community
  • 1
  • 1
Julien__
  • 1,962
  • 1
  • 15
  • 25
  • 4
    At the C++ standards committee. Good luck with that. – πάντα ῥεῖ Feb 10 '15 at 10:16
  • 7
    By writing a formal proposal and send it to the [ISO C++ committee](https://isocpp.org/std) – Some programmer dude Feb 10 '15 at 10:16
  • 3
    You may want to consider private virtual inheritance. It does the same as "composition with pointer" behind the scenes, but allows the "using" syntax. (Note that private inheritance is not considered an "is-a" relationship, if this was your concern.) – leemes Feb 10 '15 at 10:16
  • 1
    I'm voting to close this question as off-topic because it's simply outside of the scope of the site. – sashoalm Feb 10 '15 at 11:53
  • @πάνταῥεῖ What's the problem? I've had proposals adopted. It helps if you're active in the committee, of course, because no matter how well you formulate the proposal, there will be questions that people will want to ask you. – James Kanze Feb 10 '15 at 14:14
  • @JamesKanze I didn't really state there is a problem, I just know that hurdles may be high, and wish the OP _good luck_. – πάντα ῥεῖ Feb 10 '15 at 15:29
  • @Someprogrammerdude I know that this comment is dated, and I followed the link and created an account. When I looked at the website, they expressed how to submit a request for the standard library such that it might be something within the `std:: namespace`, however, I did not find anything relevant on the website about submitting a request for an actual Language Feature and not a Library extension or add on... – Francis Cugler Jan 28 '21 at 04:12
  • I’m voting to close this question because it's not programming. Search for the method for the standardization body you want to submit your idea or any of the teams creating compilers/interpreters. – Braiam Apr 28 '22 at 10:44

1 Answers1

2

Probably SO is the wrong place for your question (programmers might be a better place for it). However:

  • requesting a new C++ feature is unrealistic, unless you are a world-wide known C++ expert.
  • you could patch some C++ compiler (e.g. Clang/LLVM or GCC) to implement your feature, and publish that patch as a free software (for others to try it); you'll also need to write some code using your feature.
  • you might later contact some member from the ISO C++ standardization committee!

All this wil take you many years!

Notice that C++14 is a huge language (its specification document -see draft n3797- is heavy enough to kill someone who is thrown it) and I guess there is a heavy social and economic pressure to avoid increasing it.

Be aware that some very bright people worked several years to propose new features to C++ that ultimately become rejected (or postponed for many years)!

(for examples, Google for "concepts in C++" or "modules in C++").

BTW, you might have a more pragmatic approach to your concern. Have some specialized C++ code generator to fit your needs (that generator could be a macro-processor like gpp or m4, some specialized script in Python or Awk, or some external program like ANTLR or Qt's moc, or even a translator from some other language to C++ like MELT...).

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • Is it too naive of me to hope that proposals are judged according to their content and not their author? – Angew is no longer proud of SO Feb 10 '15 at 10:22
  • 1
    @Angew: I believe it is too naive, but I might be wrong. – Basile Starynkevitch Feb 10 '15 at 10:23
  • 3
    There's nothing unrealistic about requesting a new C++ feature, even if you're not a world class expert. Realistically, however: you'll need to be active with the committee, in order to follow up your request, and it would be a definite advantage is you could actually implement it somewhere (eg by modifying g++ or clang). – James Kanze Feb 10 '15 at 14:10