Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modern environments support C++17 well. We are wasting significant amounts of time on emulating such basic C++17 features as std::optional. We are writing worse code than we can because we lack access to such C++14 and C++17 features like std::make_unique and std::byte. The following language-standard-dependent TODOs were completed: * Switched to [[fallthrough]] attributes. * Replaced Optional with std::optional. * Replaced EnableIfType with std::enable_if_t. * Removed old C++11 type replacements (e.g., xuniform_int_distribution). * Removed std::allocator declarations deprecated in C++17. * Made ToSBuf() readable using a fold expression. * Simplified compile-time "natural type" assertions. * Used std::container::emplace*() return value where warranted. Moved BUILDCXX-setting code after AX_CXX_COMPILE_STDCXX adds -std=c++17 to CXX (rather than CXXFLAGS!). Our cf_gen was built with compiler's default C++ standard version! Ideally, BUILDCXX block should be lowered further -- other macros might alter CXX -- but its CXXFLAGS adjustment may affect subsequent code, warranting a careful/dedicated change.
- Loading branch information