Reputation: 97008
Is it possible with g++/libstdc++ to enable runtime UB checks, so that for example:
std::vector::operator[]
behaves the same as std::vector::at()
std::optional::operator*
behaves the same as std::optional::value()
I do not want to detect language level UB (that requires something like ubsan). I just want reasonable "safe" behaviour in the standard library. These should be checks appropriate for production, not ubsan/address-sanitizer.
Upvotes: 0
Views: 95