That's a good option for functions that would not return anything real, except a success indication. For other functions I really like to use std::optional to handle possible failures. This does not offer a way to tell the caller what went wrong, but there a lots of situations where that is not necessary.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.