Skip to content

Commit 27d3f7a

Browse files
committed
Compile with C++17 (#66)
1 parent cf7a241 commit 27d3f7a

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ target_include_directories(cpp-sort INTERFACE
3737
$<INSTALL_INTERFACE:include>
3838
)
3939

40-
target_compile_features(cpp-sort INTERFACE cxx_std_14)
40+
target_compile_features(cpp-sort INTERFACE cxx_std_17)
4141

4242
# MSVC won't work without a stricter standard compliance
4343
if (MSVC)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
> since there are some applications in which they turn out to be best.*
1212
> — Donald Knuth, The Art Of Computer Programming, Volume 3
1313
14-
**cpp-sort** is a generic C++14 header-only sorting library. It revolves
14+
**cpp-sort** is a generic C++17 header-only sorting library. It revolves
1515
around one main generic sorting interface and provides several small tools
1616
to pick and/or design sorting algorithms. Using its basic sorting features
1717
should be trivial enough:
@@ -121,7 +121,7 @@ page][benchmarks].
121121
![Windows builds status](https://github.com/Morwenn/cpp-sort/workflows/MSVC%20Builds/badge.svg?branch=develop)
122122
![MacOS builds status](https://github.com/Morwenn/cpp-sort/workflows/MacOS%20Builds/badge.svg?branch=develop)
123123

124-
**cpp-sort** requires C++14 support, and should work with the following compilers:
124+
**cpp-sort** requires C++17 support, and should work with the following compilers:
125125
* g++-9 or more recent.
126126
* clang++-11 or more recent (with both libstdc++ and libc++).
127127
* The versions of MinGW-w64 and AppleClang equivalent to the compilers mentioned above.

docs/Changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
This page describes the features that change in **cpp-sort** depending on the C++ version with which it is compiled (C++14 or later) as well as the support for miscellaneous compiler extensions; for a full changelog between actual releases, you can check the dedicated [releases page][cpp-sort-releases].
1+
This page describes the features that change in **cpp-sort** depending on the C++ version with which it is compiled (C++17 or later) as well as the support for miscellaneous compiler extensions; for a full changelog between actual releases, you can check the dedicated [releases page][cpp-sort-releases].
22

33
## C++14 features
44

5-
While **cpp-sort** theoretically requires a fully C++14-compliant compiler, a few standard features are either not available or deactivated in popular compilers and the library tries to take those into account if possible.
5+
While **cpp-sort** theoretically requires a fully C++17-compliant compiler, a few standard features are either not available or deactivated in some popular compilers and the library tries to take those into account when possible.
66

77
**Performance improvements:**
88
* Sized deallocation: this C++14 feature is not always available (Clang requires `-fsized-deallocation` for example) and standard allocation functions typically don't take advantage of it. However, if `__cpp_sized_deallocation` is defined and the global deallocations functions are replaced with overloads that take advantage of sized deallocation, then several sorters will explicitly try to take advantage of it.

docs/Measures-of-presortedness.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ Note however that most of these algorithms can be expensive. Using them before a
5252
Measures of presortedness can be used with the *sorter adapters* from the library. Even though most of the adapters are meaningless with measures of presortedness, some of them can still be used to mitigate space and time:
5353

5454
```cpp
55-
// C++14
55+
// With explicit template parameter
5656
auto inv = cppsort::indirect_adapter<decltype(cppsort::probe::inv)>{};
5757

58-
// C++17
58+
// With CTAD
5959
auto inv = cppsort::indirect_adapter(cppsort::probe::inv);
6060
```
6161

docs/Sorter-adapters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ In this documentation, we call *adapted sorters* the sorters passed to the adapt
99
In C++17, *sorter adapters* can be used in a function-like fashion thanks to `explicit` constructors (taking one or several sorters) by taking advantage of implicit [deduction guides][ctad]. The following example illustrates how it simplifies their use:
1010

1111
```cpp
12-
// C++14
12+
// With explicit template parameter
1313
using sorter = indirect_adapter<quick_sorter>;
1414
constexpr auto sort = sorter{};
1515

16-
// C++17
16+
// With CTAD
1717
constexpr auto sort = indirect_adapter(quick_sort);
1818
```
1919

docs/Writing-a-bubble_sorter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Generic agorithms are good, more generic algorithms are sometimes better. The cu
290290

291291
C++20 ranges introduces the notion of ["proxy iterators"][proxy-iterators], which are basically iterators that can't yield a proper reference to the object they point to, but instead yield a proxy object acting as a reference. In order to handle such iterators, C++20 introduces the *customization point objects* [`std::ranges::iter_move`][std-iter-move] and [`std::ranges::iter_swap`][std-iter-swap] which should be used instead of `std::move(*it)` and `std::iter_swap(it1, it2)` in generic algorithms that aim to support proxy iterators.
292292

293-
**cpp-sort** being a C++14 library, it can't rely on these CPOs and provides the utility functions [`utility::iter_move` and `utility::iter_swap`][utility-iter-move] to replace them. They are a bit cruder than their standard equivalents you have to import them into the current namespace and perform an unqualified call, *à la* `std::swap`.
293+
**cpp-sort** being a C++17 library, it can't rely on these CPOs and provides the utility functions [`utility::iter_move` and `utility::iter_swap`][utility-iter-move] to replace them. They are a bit cruder than their standard equivalents you have to import them into the current namespace and perform an unqualified call, *à la* `std::swap`.
294294

295295
```cpp
296296
template<typename ForwardIterator, typename Compare>

0 commit comments

Comments
 (0)