Skip to content

Commit

Permalink
Require C++17 (#1212)
Browse files Browse the repository at this point in the history
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
rousskov authored and squid-anubis committed Dec 15, 2022
1 parent 4a3b853 commit 09835fe
Show file tree
Hide file tree
Showing 64 changed files with 1,161 additions and 608 deletions.
80 changes: 0 additions & 80 deletions acinclude/ax_cxx_0x_types.m4

This file was deleted.

0 comments on commit 09835fe

Please sign in to comment.