C++20 STL Features: 1 Year of Development on GitHubspace-efficient, very time-efficient • Sorted arrays: binary_search, lower_bound, equal_range • Now you can use constexpr algorithms • Easy: static_assert with constexpr is_sorted • string_view is also constexpr; not limited to numeric data • More advanced: constexpr sort your lookup tables14 static_assert is_sorted • Compile-time evaluation = no run-time codegen, even in debug builds #include#include static constexpr array skipped_extensions{".dll"sv, ".exe"sv, ".obj"sv}; static_assert(ranges::is_sorted(skipped_extensions)); for (const auto& ent : filesystem::recursive_directory_iterator{"."}) 0 码力 | 45 页 | 702.09 KB | 6 月前3
C++23: An Overview of Almost All New and Updated Features(similar to std::map) unique keys (flat_map) fast retrieval of values based on a key Keys are sorted Keys and values are stored in separate sequence containers, e.g. vectors or deques std::flat_map0 码力 | 105 页 | 759.96 KB | 6 月前3
共 2 条
- 1













