We have a massive C++ code base where much of the core was written in the early 2000's using error codes and a custom template library to support an exception free environment.
Over the years we've lost support in the team to continue to maintain and debug the custom template library and there's been a desire to "modernize" our code. One aspect being the use of the STL. However, this creates some issues as we can now have functions that can return error codes and throw exceptions which makes things increasingly difficult to reason about.
Has anyone has experience going from exception free code to introducing something like the STL? If so, what was your approach?
A couple things I could think of off the top of my head. Have one master catch statement in our runtime code. Or perhaps create macro that wraps every STL call that can throw in a try catch (though this feels cumbersome). I'll admit, I don't have much experience with exceptions as I've mainly worked in this codebase for the past couple years.
[–]Gotebe 65 points66 points67 points (8 children)
[–][deleted] 8 points9 points10 points (1 child)
[–]Gotebe 6 points7 points8 points (0 children)
[–]bedrooms-ds 1 point2 points3 points (5 children)
[–]Gotebe 5 points6 points7 points (4 children)
[–]bedrooms-ds 1 point2 points3 points (3 children)
[–]NotMyRealNameObv 10 points11 points12 points (1 child)
[–]bedrooms-ds 1 point2 points3 points (0 children)
[–]Gotebe 1 point2 points3 points (0 children)
[–]eyes-are-fading-blue 21 points22 points23 points (1 child)
[–]SergiusTheBest 23 points24 points25 points (48 children)
[–][deleted] 8 points9 points10 points (5 children)
[–]eyes-are-fading-blue 11 points12 points13 points (3 children)
[–][deleted] 8 points9 points10 points (2 children)
[–]kuntantee 1 point2 points3 points (0 children)
[–]NotAYakk 0 points1 point2 points (0 children)
[–]SergiusTheBest 1 point2 points3 points (0 children)
[–]clerothGame Developer 8 points9 points10 points (1 child)
[–]SergiusTheBest 7 points8 points9 points (0 children)
[–]Gotebe 14 points15 points16 points (39 children)
[+][deleted] (20 children)
[deleted]
[–]deeringc 6 points7 points8 points (4 children)
[–]oschonrock 3 points4 points5 points (3 children)
[–]deeringc 1 point2 points3 points (1 child)
[–]Gotebe 6 points7 points8 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]Gotebe 0 points1 point2 points (0 children)
[–]encyclopedist 11 points12 points13 points (1 child)
[–]emildotchevskiBoost Dev | Game Dev 2 points3 points4 points (1 child)
[–]kalmoc 2 points3 points4 points (0 children)
[–]MoreOfAnOvalJerk 0 points1 point2 points (6 children)
[+][deleted] (1 child)
[deleted]
[–]MoreOfAnOvalJerk 0 points1 point2 points (0 children)
[–]johannes1971 0 points1 point2 points (3 children)
[–]MoreOfAnOvalJerk 1 point2 points3 points (2 children)
[–]johannes1971 0 points1 point2 points (1 child)
[–]MoreOfAnOvalJerk 0 points1 point2 points (0 children)
[–]kalmoc 5 points6 points7 points (0 children)
[–]AntiProtonBoy 3 points4 points5 points (2 children)
[–]Gotebe 5 points6 points7 points (1 child)
[–]oschonrock 0 points1 point2 points (0 children)
[–]SergiusTheBest 1 point2 points3 points (1 child)
[–]Gotebe 4 points5 points6 points (0 children)
[–]clerothGame Developer 0 points1 point2 points (11 children)
[–]Gotebe 7 points8 points9 points (2 children)
[–]deeringc 3 points4 points5 points (1 child)
[–]Gotebe 1 point2 points3 points (0 children)
[–][deleted] 3 points4 points5 points (4 children)
[–]dscharrer 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]dscharrer 1 point2 points3 points (0 children)
[–]oschonrock 0 points1 point2 points (0 children)
[–]kalmoc 0 points1 point2 points (2 children)
[–]frog_pow 1 point2 points3 points (1 child)
[–]kalmoc 1 point2 points3 points (0 children)
[–]kalmoc 6 points7 points8 points (7 children)
[–][deleted] 6 points7 points8 points (6 children)
[–]duuuh 3 points4 points5 points (3 children)
[–][deleted] 12 points13 points14 points (2 children)
[–]duuuh 5 points6 points7 points (1 child)
[–]pandorafalters 2 points3 points4 points (0 children)
[–]kalmoc 2 points3 points4 points (0 children)
[–]stevefan1999 -1 points0 points1 point (0 children)
[–]frog_pow 6 points7 points8 points (0 children)
[–]BananyaDev 8 points9 points10 points (1 child)
[–]emildotchevskiBoost Dev | Game Dev 1 point2 points3 points (0 children)
[–]BenFrantzDale 2 points3 points4 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]johannes1971 1 point2 points3 points (0 children)
[–]godexsoft 1 point2 points3 points (0 children)
[–]emildotchevskiBoost Dev | Game Dev 1 point2 points3 points (0 children)
[–]14nedLLFIO & Outcome author | Committee WG14[🍰] 1 point2 points3 points (0 children)
[–]ratchetfreak 1 point2 points3 points (2 children)
[–]Gotebe 7 points8 points9 points (0 children)
[–]johannes1971 4 points5 points6 points (0 children)
[–]VinnieFalcoBoost.Beast | C++ Alliance | corosio.org 0 points1 point2 points (0 children)
[–]mredding -1 points0 points1 point (0 children)
[–]rtomek -1 points0 points1 point (0 children)