4 ms·
C# and Java both have `sealed` for that, too.
by WorldMaker 1y ago
C# and Java both have `sealed` for that, too.
- throwaway2037 1y agoNitpick: It is called "final" in Java, but your point stands. As I understand, C++ borrowed their "final" keyword from Java/C#. I'm not trolling when I write that last sentence. That is something that has really changed about C+ since the C++-11 committee was started -- and continues. When people write language / library proposals, they now regularly survey the landscape and talk about their experiences with other languages / libraries.
- WorldMaker 1y agoTechnically Java has both `final` and `sealed`, and the distinction between the two is complicated, but `sealed` is the more powerful/capable/adjustable of the two. But the rest of your point stands and it does seem useful that C++ is paying more attention to the large ecosystems of its descendant languages and other relatives.
- throwaway2037 1y agoHoly shit: I stand corrected about sealed keyword in Java! It was added in Java 17. <Hat tip>