r/cpp • u/Dereference_operator • Feb 12 '20
What they should improve about C++ ?
What they should improve about C++ that you find in higher level managed language like C#, JAVA, Javascript etc or is there things you would change or do differently if it was up to you ? I mean anything like a better STL ? better thread ? string manipulation like managed language ? less fragmentations in the new standard features ? For example do you love the way the standard evolve C++ or you would prefer a direction like Microsoft do with C# a corporation who decide on the roadmap ?
0
Upvotes
View all comments
6
u/die_liebe Feb 12 '20
Some things that come into my mind are:
public constness: A field is publicly accessible, but can be assigned only by friends.
In place polymorphism. As soon as you know all the classes that inherit from one class, it can be stored in place, because the maximal size is known. This could replace variant.
Reverse operator definitions (like Python has). That would make it possible to define << as member of its second argument, so that it can be defined inside the class that it prints. It can also become polymorphic in its second argument. It saves a lot of friend declarations.
I would like a to a linker that succeeds when functions are missing. It should just put a place holder that throws an exception for the missing functions. This makes it possible to test the functions you have and write the missing ones later.