The assert() macro has various issues, e.g., discussed here: https://www.softwariness.com/articles/assertions-in-cpp/ We should follow the recommendation there and replace them with exceptions thrown.