| |
| ▲ | vodou a day ago | parent | next [-] | | Not my experience. I work with a -fno-exceptions codebase. Still quite a lot of std left. (Exceptions come with a surprisingly hefty binary size cost.) | | |
| ▲ | theICEBeardk a day ago | parent | next [-] | | Apparently according to some ACCU and CPPCon talks by Khalil Estel this can be largely mitigated even in embedded lowering the size cost by orders of magnitude. | | | |
| ▲ | elteto a day ago | parent | prev [-] | | Not exactly sure what your experience is, but if you work with in an -fno-exceptions codebase then you know that STL containers are not usable in that regime (with the exception of std::tuple it seems, see freestanding comment below). I would argue that the majority of use cases of the STL is for its containers. So, what exact parts of the STL do you use in your code base? Most be mostly compile time stuff (types, type trait, etc). | | |
| ▲ | alchemio a day ago | parent [-] | | You can use std containers in a no-exceptions environment. Just know that if an error occurs the program will terminate. | | |
| ▲ | WD-42 a day ago | parent | next [-] | | We've banned exceptions! If any occur, we just don't catch them. | |
| ▲ | elteto a day ago | parent | prev [-] | | So you can’t use them then. | | |
| ▲ | _flux 19 hours ago | parent [-] | | I don't think it would be typical to depend on exception handling when dealing with boundary conditions with C++ containers. I mean .at is great and all, but it's really for the benefit of eliminating undefined behavior and if the program just terminates then you've achieved this. I've seen decoders that just catch the std::out_of_range or even std::exception to handle the remaining bugs in the logic, though. |
|
|
|
| |
| ▲ | theICEBeardk a day ago | parent | prev [-] | | 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. | | |
| ▲ | elteto a day ago | parent [-] | | 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. |
|
|