If statememnt can be written with consteval keyword to executed different code depending whether if function is executed during compile time or during run-time.
constexpr bool is_constant_evaluated() noexcept {
if consteval { return true; }
else { return false; }
}
constexpr bool is_runtime_evaluated() noexcept {
if not consteval { return true; }
else { return false; }
}- Init statement in range based for loop can be alias declaration
Optional has 3 methods add to enable functional style programming:
- and_then
- or_else
- transform
Error handling type similar to optional.
std::ranges::starts_withandstd::ranges::ends_withis addedstd::ranges::shift_leftandstd::ranges::shift_rightis addedstd::ranges::fold_leftandstd::ranges::fold_rightis addedstd::ranges::iotais addedstd::ranges::tois addedstd::ranges::views::zipis addedstd::ranges::views::zip_transformis addedstd::ranges::views::adjacentis addedstd::ranges::views::adjacent_transformis addedstd::ranges::views::join_withis addedstd::ranges::views::slideis addedstd::ranges::views::chunkis addedstd::ranges::views::chunk_byis addedstd::ranges::views::repeatis addedstd::ranges::views::cartesian_productis addedstd::ranges::views::as_constis addedstd::ranges::views::as_rvalueis addedstd::ranges::views::strideis added
- access currently executing stack trace has been added
bind_backadded for wrapping a function with last parameters specified- compatibility macro _Atomic provided such that
_Atomic(T)is identical toatomic<T> - more functions (
erase,extract,insert,insert_or_assign,operator[],bucket) aware of transparent/heterogenous searching - garabage collector related basics introduced in C++11 are removed
stringandstring_viewhavecontainsmethod added