Skip to content

Commit ca5f6d9

Browse files
committed
Don't use implementation details for old sorters
We are removing old sorters, partitally because it is assumed that users can reimplement them with simple compositions of existing components. Using implementation details to reimplement them defeats the point.
1 parent 2df2ed4 commit ca5f6d9

File tree

1 file changed

+27
-35
lines changed

1 file changed

+27
-35
lines changed

tests/testing-tools/old_sorters.h

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,16 @@ struct old_default_sorter:
4545
>
4646
{};
4747

48-
namespace cppsort
48+
template<>
49+
struct cppsort::stable_adapter<::old_default_sorter>:
50+
cppsort::merge_sorter
4951
{
50-
template<>
51-
struct stable_adapter<::old_default_sorter>:
52-
cppsort::merge_sorter
53-
{
54-
stable_adapter() = default;
52+
stable_adapter() = default;
5553

56-
constexpr explicit stable_adapter(const ::old_default_sorter&) noexcept:
57-
stable_adapter()
58-
{}
59-
};
60-
}
54+
constexpr explicit stable_adapter(const ::old_default_sorter&) noexcept:
55+
stable_adapter()
56+
{}
57+
};
6158

6259
////////////////////////////////////////////////////////////
6360
// drop_merge_sorter
@@ -94,34 +91,29 @@ struct old_verge_sorter:
9491
old_verge_sorter() = default;
9592
};
9693

97-
namespace cppsort
94+
template<>
95+
struct cppsort::stable_adapter<::old_verge_sorter>:
96+
cppsort::stable_t<
97+
cppsort::verge_adapter<
98+
cppsort::hybrid_adapter<
99+
cppsort::pdq_sorter,
100+
cppsort::quick_merge_sorter
101+
>
102+
>
103+
>
98104
{
99-
template<>
100-
struct stable_adapter<::old_verge_sorter>:
101-
cppsort::sorter_facade<
102-
cppsort::detail::verge_adapter_impl<
105+
stable_adapter() = default;
106+
107+
constexpr explicit stable_adapter(const ::old_verge_sorter&):
108+
cppsort::stable_t<
109+
cppsort::verge_adapter<
103110
cppsort::hybrid_adapter<
104111
cppsort::pdq_sorter,
105112
cppsort::quick_merge_sorter
106-
>,
107-
true
108-
>
109-
>
110-
{
111-
stable_adapter() = default;
112-
113-
constexpr explicit stable_adapter(const ::old_verge_sorter&):
114-
cppsort::sorter_facade<
115-
cppsort::detail::verge_adapter_impl<
116-
cppsort::hybrid_adapter<
117-
cppsort::pdq_sorter,
118-
cppsort::quick_merge_sorter
119-
>,
120-
true
121113
>
122-
>()
123-
{}
124-
};
125-
}
114+
>
115+
>()
116+
{}
117+
};
126118

127119
#endif // CPPSORT_TESTSUITE_OLD_SORTERS_H_

0 commit comments

Comments
 (0)