Skip to content

Commit 3761f85

Browse files
authored
Merge pull request #129 from Morwenn/develop
Release 1.1.1
2 parents bf016b8 + bb05e4e commit 3761f85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+422
-549
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ matrix:
9191
after_success:
9292
- conan remote add bintray https://api.bintray.com/conan/morwenn/cpp-sort
9393
- conan user -r bintray -p ${CONAN_PASSWORD} morwenn
94-
- conan upload --all -r bintray cpp-sort/1.1.0@morwenn/stable
94+
- conan upload --all -r bintray cpp-sort/1.1.1@morwenn/stable
9595

9696
before_install:
9797
- if [[ $TRAVIS_OS_NAME = "osx" ]]; then

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Latest Release](https://img.shields.io/badge/release-cpp--sort%2F1.1.0-blue.svg)](https://github.com/Morwenn/cpp-sort/releases)
1+
[![Latest Release](https://img.shields.io/badge/release-cpp--sort%2F1.1.1-blue.svg)](https://github.com/Morwenn/cpp-sort/releases)
22
[![Build Status](https://travis-ci.org/Morwenn/cpp-sort.svg?branch=master)](https://travis-ci.org/Morwenn/cpp-sort)
33
[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
44
[![Code Coverage](https://codecov.io/gh/Morwenn/cpp-sort/branch/master/graph/badge.svg)](https://codecov.io/gh/Morwenn/cpp-sort)
@@ -51,7 +51,6 @@ Here is a more complete example of what can be done with the library:
5151
#include <iterator>
5252
#include <vector>
5353
#include <cpp-sort/adapters.h>
54-
#include <cpp-sort/sort.h>
5554
#include <cpp-sort/sorters.h>
5655

5756
int main()

conanfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class CppSortConan(ConanFile):
55
name = "cpp-sort"
6-
version = "1.1.0"
6+
version = "1.1.1"
77
settings = "compiler"
88
license = "https://github.com/Morwenn/cpp-sort/blob/master/license.txt"
99
url = "https://github.com/Morwenn/cpp-sort"

include/cpp-sort/adapters/container_aware_adapter.h

+21-22
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
#include <cpp-sort/sort.h>
3434
#include <cpp-sort/sorter_facade.h>
3535
#include <cpp-sort/sorter_traits.h>
36-
#include "../detail/is_callable.h"
37-
#include "../detail/logical_traits.h"
3836
#include "../detail/projection_compare.h"
37+
#include "../detail/type_traits.h"
3938

4039
namespace cppsort
4140
{
@@ -76,34 +75,34 @@ namespace cppsort
7675
template<typename Sorter, typename Iterable>
7776
struct can_sort:
7877
conjunction<
79-
is_callable<adl_despair(Sorter, Iterable&)>,
80-
negation<is_callable<adl_despair(Sorter, Iterable&), nope_type>>
78+
is_invocable<adl_despair, Sorter, Iterable&>,
79+
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&>>
8180
>
8281
{};
8382

8483
template<typename Sorter, typename Iterable, typename Compare>
8584
struct can_comparison_sort:
8685
conjunction<
87-
is_callable<adl_despair(Sorter, Iterable&, Compare)>,
88-
negation<is_callable<adl_despair(Sorter, Iterable&, Compare), nope_type>>,
86+
is_invocable<adl_despair, Sorter, Iterable&, Compare>,
87+
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Compare>>,
8988
is_projection<utility::identity, Iterable, Compare>
9089
>
9190
{};
9291

9392
template<typename Sorter, typename Iterable, typename Projection>
9493
struct can_projection_sort:
9594
conjunction<
96-
is_callable<adl_despair(Sorter, Iterable&, Projection)>,
97-
negation<is_callable<adl_despair(Sorter, Iterable&, Projection), nope_type>>,
95+
is_invocable<adl_despair, Sorter, Iterable&, Projection>,
96+
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Projection>>,
9897
is_projection<Projection, Iterable>
9998
>
10099
{};
101100

102101
template<typename Sorter, typename Iterable, typename Compare, typename Projection>
103102
struct can_comparison_projection_sort:
104103
conjunction<
105-
is_callable<adl_despair(Sorter, Iterable&, Compare, Projection)>,
106-
negation<is_callable<adl_despair(Sorter, Iterable&, Compare, Projection), nope_type>>,
104+
is_invocable<adl_despair, Sorter, Iterable&, Compare, Projection>,
105+
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Compare, Projection>>,
107106
is_projection<Projection, Iterable, Compare>
108107
>
109108
{};
@@ -118,7 +117,7 @@ namespace cppsort
118117
auto operator()(Iterable& iterable) const
119118
-> std::enable_if_t<
120119
detail::can_sort<Sorter, Iterable>::value,
121-
std::conditional_t<
120+
conditional_t<
122121
Stability,
123122
std::false_type,
124123
decltype(detail::adl_despair{}(Sorter{}, iterable))
@@ -135,7 +134,7 @@ namespace cppsort
135134
auto operator()(Iterable& iterable) const
136135
-> std::enable_if_t<
137136
not detail::can_sort<Sorter, Iterable>::value,
138-
std::conditional_t<
137+
conditional_t<
139138
Stability,
140139
cppsort::is_stable<Sorter(Iterable&)>,
141140
decltype(cppsort::sort(Sorter{}, iterable))
@@ -153,7 +152,7 @@ namespace cppsort
153152
auto operator()(Iterable& iterable, Compare compare) const
154153
-> std::enable_if_t<
155154
detail::can_comparison_sort<Sorter, Iterable, Compare>::value,
156-
std::conditional_t<
155+
conditional_t<
157156
Stability,
158157
std::false_type,
159158
decltype(detail::adl_despair{}(Sorter{}, iterable, std::move(compare)))
@@ -172,7 +171,7 @@ namespace cppsort
172171
-> std::enable_if_t<
173172
not is_projection<Compare, Iterable>::value &&
174173
not detail::can_comparison_sort<Sorter, Iterable, Compare>::value,
175-
std::conditional_t<
174+
conditional_t<
176175
Stability,
177176
cppsort::is_stable<Sorter(Iterable&, Compare)>,
178177
decltype(cppsort::sort(Sorter{}, iterable, std::move(compare)))
@@ -191,7 +190,7 @@ namespace cppsort
191190
-> std::enable_if_t<
192191
not detail::can_comparison_sort<Sorter, Iterable, Projection>::value &&
193192
detail::can_projection_sort<Sorter, Iterable, Projection>::value,
194-
std::conditional_t<
193+
conditional_t<
195194
Stability,
196195
std::false_type,
197196
decltype(detail::adl_despair{}(Sorter{}, iterable, std::move(projection)))
@@ -210,7 +209,7 @@ namespace cppsort
210209
-> std::enable_if_t<
211210
not detail::can_projection_sort<Sorter, Iterable, Projection>::value &&
212211
detail::can_comparison_projection_sort<Sorter, Iterable, std::less<>, Projection>::value,
213-
std::conditional_t<
212+
conditional_t<
214213
Stability,
215214
std::false_type,
216215
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -236,7 +235,7 @@ namespace cppsort
236235
Iterable,
237236
detail::projection_compare<std::less<>, Projection>
238237
>::value,
239-
std::conditional_t<
238+
conditional_t<
240239
Stability,
241240
std::false_type,
242241
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -265,7 +264,7 @@ namespace cppsort
265264
Iterable,
266265
detail::projection_compare<std::less<>, Projection>
267266
>::value,
268-
std::conditional_t<
267+
conditional_t<
269268
Stability,
270269
cppsort::is_stable<Sorter(Iterable&, Projection)>,
271270
decltype(cppsort::sort(Sorter{}, iterable, std::move(projection)))
@@ -284,7 +283,7 @@ namespace cppsort
284283
auto operator()(Iterable& iterable, Compare compare, Projection projection) const
285284
-> std::enable_if_t<
286285
detail::can_comparison_projection_sort<Sorter, Iterable, Compare, Projection>::value,
287-
std::conditional_t<
286+
conditional_t<
288287
Stability,
289288
std::false_type,
290289
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -310,7 +309,7 @@ namespace cppsort
310309
Iterable,
311310
detail::projection_compare<Compare, Projection>
312311
>::value,
313-
std::conditional_t<
312+
conditional_t<
314313
Stability,
315314
std::false_type,
316315
decltype(detail::adl_despair{}(Sorter{}, iterable,
@@ -338,7 +337,7 @@ namespace cppsort
338337
Iterable,
339338
detail::projection_compare<Compare, Projection>
340339
>::value,
341-
std::conditional_t<
340+
conditional_t<
342341
Stability,
343342
cppsort::is_stable<Sorter(Iterable&, Compare, Projection)>,
344343
decltype(cppsort::sort(Sorter{}, iterable,
@@ -360,7 +359,7 @@ namespace cppsort
360359
container_aware_adapter() = default;
361360

362361
// Automatic deduction guide
363-
constexpr container_aware_adapter(Sorter) noexcept {}
362+
constexpr explicit container_aware_adapter(Sorter) noexcept {}
364363
};
365364

366365
////////////////////////////////////////////////////////////

include/cpp-sort/adapters/counting_adapter.h

+3-6
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
////////////////////////////////////////////////////////////
2828
// Headers
2929
////////////////////////////////////////////////////////////
30-
#include <cstddef>
3130
#include <functional>
3231
#include <type_traits>
3332
#include <utility>
33+
#include <cpp-sort/fwd.h>
3434
#include <cpp-sort/sorter_facade.h>
3535
#include <cpp-sort/sorter_traits.h>
3636
#include "../detail/checkers.h"
@@ -119,10 +119,7 @@ namespace cppsort
119119
};
120120
}
121121

122-
template<
123-
typename ComparisonSorter,
124-
typename CountType = std::size_t
125-
>
122+
template<typename ComparisonSorter, typename CountType>
126123
struct counting_adapter:
127124
sorter_facade<detail::counting_adapter_impl<
128125
ComparisonSorter,
@@ -132,7 +129,7 @@ namespace cppsort
132129
counting_adapter() = default;
133130

134131
// Automatic deduction guide
135-
constexpr counting_adapter(ComparisonSorter) noexcept {}
132+
constexpr explicit counting_adapter(ComparisonSorter) noexcept {}
136133
};
137134

138135
////////////////////////////////////////////////////////////

include/cpp-sort/adapters/hybrid_adapter.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <cpp-sort/sorter_facade.h>
3535
#include <cpp-sort/sorter_traits.h>
3636
#include "../detail/checkers.h"
37-
#include "../detail/is_callable.h"
3837
#include "../detail/iterator_traits.h"
3938

4039
namespace cppsort
@@ -119,7 +118,7 @@ namespace cppsort
119118
template<typename... Args>
120119
static auto _detail_stability(choice<Ind>, Args&&... args)
121120
-> std::enable_if_t<
122-
is_callable_v<Sorter(Args...)>,
121+
is_invocable_v<Sorter, Args...>,
123122
is_stable<Sorter(Args...)>
124123
>;
125124
};
@@ -129,7 +128,7 @@ namespace cppsort
129128
// Adapter
130129

131130
template<typename... Sorters>
132-
class hybrid_adapter:
131+
struct hybrid_adapter:
133132
public detail::check_iterator_category<Sorters...>,
134133
public detail::check_is_always_stable<Sorters...>,
135134
public sorter_facade_fptr<hybrid_adapter<Sorters...>>
@@ -139,7 +138,7 @@ namespace cppsort
139138
hybrid_adapter() = default;
140139

141140
// Automatic deduction guide
142-
constexpr hybrid_adapter(Sorters...) noexcept {};
141+
constexpr explicit hybrid_adapter(Sorters...) noexcept {}
143142

144143
private:
145144

include/cpp-sort/adapters/indirect_adapter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ namespace cppsort
130130
indirect_adapter() = default;
131131

132132
// Automatic deduction guide
133-
constexpr indirect_adapter(Sorter) noexcept {}
133+
constexpr explicit indirect_adapter(Sorter) noexcept {}
134134
};
135135

136136
////////////////////////////////////////////////////////////

include/cpp-sort/adapters/schwartz_adapter.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "../detail/associate_iterator.h"
4040
#include "../detail/checkers.h"
4141
#include "../detail/memory.h"
42-
#include "../detail/remove_cvref.h"
42+
#include "../detail/type_traits.h"
4343

4444
namespace cppsort
4545
{
@@ -113,7 +113,7 @@ namespace cppsort
113113
schwartz_adapter() = default;
114114

115115
// Automatic deduction guide
116-
constexpr schwartz_adapter(Sorter) noexcept {}
116+
constexpr explicit schwartz_adapter(Sorter) noexcept {}
117117
};
118118

119119
////////////////////////////////////////////////////////////

include/cpp-sort/adapters/self_sort_adapter.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <cpp-sort/sorter_traits.h>
3636
#include <cpp-sort/utility/as_function.h>
3737
#include "../detail/checkers.h"
38-
#include "../detail/detection.h"
38+
#include "../detail/type_traits.h"
3939

4040
namespace cppsort
4141
{
@@ -87,7 +87,7 @@ namespace cppsort
8787
self_sort_adapter() = default;
8888

8989
// Automatic deduction guide
90-
constexpr self_sort_adapter(Sorter) noexcept {};
90+
constexpr explicit self_sort_adapter(Sorter) noexcept {}
9191

9292
////////////////////////////////////////////////////////////
9393
// Function call operator
@@ -149,10 +149,10 @@ namespace cppsort
149149

150150
template<typename Sorter, typename... Args>
151151
struct is_stable<self_sort_adapter<Sorter>(Args...)>:
152-
std::conditional_t<
152+
detail::conditional_t<
153153
detail::has_sort_method<Args...>,
154154
std::false_type,
155-
std::conditional_t<
155+
detail::conditional_t<
156156
detail::has_stable_sort_method<Args...>,
157157
std::true_type,
158158
is_stable<Sorter(Args...)>
@@ -167,7 +167,7 @@ namespace cppsort
167167

168168
template<typename Sorter, typename T, typename Function>
169169
struct is_stable<self_sort_adapter<Sorter>(std::forward_list<T>&, Function)>:
170-
std::conditional_t<
170+
detail::conditional_t<
171171
is_projection_v<Function, std::forward_list<T>&>,
172172
is_stable<Sorter(std::forward_list<T>&, Function)>,
173173
std::true_type
@@ -181,7 +181,7 @@ namespace cppsort
181181

182182
template<typename Sorter, typename T, typename Function>
183183
struct is_stable<self_sort_adapter<Sorter>(std::list<T>&, Function)>:
184-
std::conditional_t<
184+
detail::conditional_t<
185185
is_projection_v<Function, std::list<T>&>,
186186
is_stable<Sorter(std::list<T>&, Function)>,
187187
std::true_type

include/cpp-sort/adapters/small_array_adapter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#include <utility>
3434
#include <cpp-sort/sorter_facade.h>
3535
#include <cpp-sort/sorter_traits.h>
36-
#include "../detail/detection.h"
3736
#include "../detail/is_in_pack.h"
37+
#include "../detail/type_traits.h"
3838

3939
namespace cppsort
4040
{

include/cpp-sort/adapters/stable_adapter.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ namespace cppsort
168168
make_stable() = default;
169169

170170
// Automatic deduction guide
171-
constexpr make_stable(Sorter) noexcept {};
171+
constexpr explicit make_stable(Sorter) noexcept {}
172172
};
173173

174174
// Actual sorter
@@ -180,7 +180,7 @@ namespace cppsort
180180
stable_adapter() = default;
181181

182182
// Automatic deduction guide
183-
constexpr stable_adapter(Sorter) noexcept {}
183+
constexpr explicit stable_adapter(Sorter) noexcept {}
184184

185185

186186
template<

include/cpp-sort/adapters/verge_adapter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace cppsort
8686
verge_adapter() = default;
8787

8888
// Automatic deduction guide
89-
constexpr verge_adapter(FallbackSorter) noexcept {}
89+
constexpr explicit verge_adapter(FallbackSorter) noexcept {}
9090
};
9191
}
9292

0 commit comments

Comments
 (0)