←back to thread

327 points AareyBaba | 2 comments | | HN request time: 0s | source
Show context
mwkaufma ◴[] No.46183728[source]
TL;DR

- no exceptions

- no recursion

- no malloc()/free() in the inner-loop

replies(9): >>46183820 #>>46183900 #>>46184073 #>>46184113 #>>46184198 #>>46184398 #>>46184472 #>>46184588 #>>46185500 #
wiseowise ◴[] No.46183900[source]
That’s hardly 90% of C++.
replies(2): >>46183975 #>>46184047 #
elteto ◴[] No.46184047[source]
If you compile with -fno-exceptions you just lost almost all of the STL.

You can compile with exceptions enabled, use the STL, but strictly enforce no allocations after initialization. It depends on how strict is the spec you are trying to hit.

replies(2): >>46184298 #>>46184314 #
1. theICEBeardk ◴[] No.46184314[source]
Are you aware of the Freestanding definition of STL? See here: https://en.cppreference.com/w/cpp/freestanding.html Large and useful parts of it are available if you run with a newer c++ standard.
replies(1): >>46184623 #
2. elteto ◴[] No.46184623[source]
Well, it's mostly type definitions and compiler stuff, like type_traits. Although I'm pleasantly surprised that std::tuple is fully supported. It looks like C++26 will bring in a lot more support for freestanding stuff.

No algorithms or containers, which to me is probably 90% of what is most heavily used of the STL.