4 ms·
> That means you need to write code that wraps every possible resource in RAII logic. This is a great point. It means that you cannot mix C and C++ code withou
by CyberRabbi 5y ago
> That means you need to write code that wraps every possible resource in RAII logic.
This is a great point. It means that you cannot mix C and C++ code without care, which seems like a huge design smell to me especially since this is not something that can easily be verified statically.
Using C++ with exceptions disabled is the only foolproof way to run it in a large heterogenous application.
- AlexandrB 5y ago> Using C++ with exceptions disabled is the only foolproof way to run it in a large heterogenous application. Is there a way for a ctor to report failure in newer C++ standards or are exceptions still the only way[1]? [1] https://www.yosefk.com/c++fqa/exceptions.html#fqa-17.2 https://www.yosefk.com/c++fqa/exceptions.html#fqa-17.2
- CyberRabbi 5y agoExceptions are the only way. You can workaround this by using static factory methods. The herbceptions proposal for “deterministic” exceptions addressed this issue well IMO.
- pjmlp 5y agoI doubt that proposal ever gets adopted.
- CyberRabbi 5y agoI also doubt it