- 
                Notifications
    
You must be signed in to change notification settings  - Fork 62
 
Changelog
This page describes the features that change in cpp-sort depending on the C++ version with which it is compiled (C++14 or later); for a full changelog between actual releases, you can check the dedicated releases page.
When compiled with C++17, cpp-sort might gain a few additional features depending on the level of C++17 support provided by the compiler. The availability of most of the features depend on the presence of corresponding feature-testing macros. The support for feature-testing macros being optional, it is possible that one of the features listed below isn't available even though the compiler is supposed to provide enough C++17 features to support it. If it is the case and it is a problem for you, don't hesitate to open an issue so that we can explicitly support the given compiler.
New features:
- 
string_spread_sortnow acceptsstd::string_viewand sometimesstd::wstring_view.This feature is made available through the check
__cplusplus > 201402L && __has_include(<string_view>). - 
Sorter adapters have been updated to take advantage of deduction guides:
// C++14 constexpr auto sort = schwartz_adapter<quick_sorter>{}; // C++17 constexpr auto sort = schwartz_adapter(quick_sort);
This notably makes measures of presortedness more usable with the few sorter adapters that make sense for them:
// C++14 auto rem = indirect_adapter<decltype(probe::rem)>{}; // C++17 auto rem = indirect_adapter(probe::rem);
There is no specific check for this feature: it works out-of-the box when implicit deduction guides work.
 - 
New
function_constantutility to micro-optimize function pointers and class member pointers.insertion_sort(collection, function_constant<&foo::bar>{});It sometimes results in fewer indirections than a raw
&foo::bar, and can be subject to empty base class optimization when stored.This feature is available when the feature-testing macro
__cpp_nontype_template_parameter_autois defined. - 
The function pointer conversion operators of
sorter_facadeare nowconstexprwhen possible.This feature is made available through the check
__cpp_constexpr >= 201603. 
Performance improvements:
- 
merge_insertion_sortercan be somewhat more performant when libstdc++'sbitmap_allocatoris available.This improvement is made available through the check
__has_include(<ext/bitmap_allocator.h>), which means that it may also be available for non-standard pre-C++17 builds where__has_includeis available. 
This branch is a "clean" C++17 branch which assumes that all C++17 features are available in the current compiler & standard library. It gets rid of legacy features and simplifies the code where possible. It notably comes with every C++17 improvement described above.
Removed features:
- 
<cpp-sort/utility/static_const.h>is gone:inlinevariables can be used instead. 
Branch name: c++17
Compatible compilers: g++7, clang++5.0
- Home
 - Quickstart
 - Sorting library
 - Comparators and projections
 - Miscellaneous utilities
 - Tutorials
 - Tooling
 - Benchmarks
 - Changelog
 - Original research