Skip to content

Commit

Permalink
Merge pull request #129 from Morwenn/develop
Browse files Browse the repository at this point in the history
Release 1.1.1
  • Loading branch information
Morwenn committed Mar 29, 2018
2 parents bf016b8 + bb05e4e commit 3761f85
Show file tree
Hide file tree
Showing 50 changed files with 422 additions and 549 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -91,7 +91,7 @@ matrix:
after_success:
- conan remote add bintray https://api.bintray.com/conan/morwenn/cpp-sort
- conan user -r bintray -p ${CONAN_PASSWORD} morwenn
- conan upload --all -r bintray cpp-sort/1.1.0@morwenn/stable
- conan upload --all -r bintray cpp-sort/1.1.1@morwenn/stable

before_install:
- if [[ $TRAVIS_OS_NAME = "osx" ]]; then
Expand Down
3 changes: 1 addition & 2 deletions README.md
@@ -1,4 +1,4 @@
[![Latest Release](https://img.shields.io/badge/release-cpp--sort%2F1.1.0-blue.svg)](https://github.com/Morwenn/cpp-sort/releases)
[![Latest Release](https://img.shields.io/badge/release-cpp--sort%2F1.1.1-blue.svg)](https://github.com/Morwenn/cpp-sort/releases)
[![Build Status](https://travis-ci.org/Morwenn/cpp-sort.svg?branch=master)](https://travis-ci.org/Morwenn/cpp-sort)
[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
[![Code Coverage](https://codecov.io/gh/Morwenn/cpp-sort/branch/master/graph/badge.svg)](https://codecov.io/gh/Morwenn/cpp-sort)
Expand Down Expand Up @@ -51,7 +51,6 @@ Here is a more complete example of what can be done with the library:
#include <iterator>
#include <vector>
#include <cpp-sort/adapters.h>
#include <cpp-sort/sort.h>
#include <cpp-sort/sorters.h>

int main()
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Expand Up @@ -3,7 +3,7 @@

class CppSortConan(ConanFile):
name = "cpp-sort"
version = "1.1.0"
version = "1.1.1"
settings = "compiler"
license = "https://github.com/Morwenn/cpp-sort/blob/master/license.txt"
url = "https://github.com/Morwenn/cpp-sort"
Expand Down
43 changes: 21 additions & 22 deletions include/cpp-sort/adapters/container_aware_adapter.h
Expand Up @@ -33,9 +33,8 @@
#include <cpp-sort/sort.h>
#include <cpp-sort/sorter_facade.h>
#include <cpp-sort/sorter_traits.h>
#include "../detail/is_callable.h"
#include "../detail/logical_traits.h"
#include "../detail/projection_compare.h"
#include "../detail/type_traits.h"

namespace cppsort
{
Expand Down Expand Up @@ -76,34 +75,34 @@ namespace cppsort
template<typename Sorter, typename Iterable>
struct can_sort:
conjunction<
is_callable<adl_despair(Sorter, Iterable&)>,
negation<is_callable<adl_despair(Sorter, Iterable&), nope_type>>
is_invocable<adl_despair, Sorter, Iterable&>,
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&>>
>
{};

template<typename Sorter, typename Iterable, typename Compare>
struct can_comparison_sort:
conjunction<
is_callable<adl_despair(Sorter, Iterable&, Compare)>,
negation<is_callable<adl_despair(Sorter, Iterable&, Compare), nope_type>>,
is_invocable<adl_despair, Sorter, Iterable&, Compare>,
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Compare>>,
is_projection<utility::identity, Iterable, Compare>
>
{};

template<typename Sorter, typename Iterable, typename Projection>
struct can_projection_sort:
conjunction<
is_callable<adl_despair(Sorter, Iterable&, Projection)>,
negation<is_callable<adl_despair(Sorter, Iterable&, Projection), nope_type>>,
is_invocable<adl_despair, Sorter, Iterable&, Projection>,
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Projection>>,
is_projection<Projection, Iterable>
>
{};

template<typename Sorter, typename Iterable, typename Compare, typename Projection>
struct can_comparison_projection_sort:
conjunction<
is_callable<adl_despair(Sorter, Iterable&, Compare, Projection)>,
negation<is_callable<adl_despair(Sorter, Iterable&, Compare, Projection), nope_type>>,
is_invocable<adl_despair, Sorter, Iterable&, Compare, Projection>,
negation<is_invocable_r<nope_type, adl_despair, Sorter, Iterable&, Compare, Projection>>,
is_projection<Projection, Iterable, Compare>
>
{};
Expand All @@ -118,7 +117,7 @@ namespace cppsort
auto operator()(Iterable& iterable) const
-> std::enable_if_t<
detail::can_sort<Sorter, Iterable>::value,
std::conditional_t<
conditional_t<
Stability,
std::false_type,
decltype(detail::adl_despair{}(Sorter{}, iterable))
Expand All @@ -135,7 +134,7 @@ namespace cppsort
auto operator()(Iterable& iterable) const
-> std::enable_if_t<
not detail::can_sort<Sorter, Iterable>::value,
std::conditional_t<
conditional_t<
Stability,
cppsort::is_stable<Sorter(Iterable&)>,
decltype(cppsort::sort(Sorter{}, iterable))
Expand All @@ -153,7 +152,7 @@ namespace cppsort
auto operator()(Iterable& iterable, Compare compare) const
-> std::enable_if_t<
detail::can_comparison_sort<Sorter, Iterable, Compare>::value,
std::conditional_t<
conditional_t<
Stability,
std::false_type,
decltype(detail::adl_despair{}(Sorter{}, iterable, std::move(compare)))
Expand All @@ -172,7 +171,7 @@ namespace cppsort
-> std::enable_if_t<
not is_projection<Compare, Iterable>::value &&
not detail::can_comparison_sort<Sorter, Iterable, Compare>::value,
std::conditional_t<
conditional_t<
Stability,
cppsort::is_stable<Sorter(Iterable&, Compare)>,
decltype(cppsort::sort(Sorter{}, iterable, std::move(compare)))
Expand All @@ -191,7 +190,7 @@ namespace cppsort
-> std::enable_if_t<
not detail::can_comparison_sort<Sorter, Iterable, Projection>::value &&
detail::can_projection_sort<Sorter, Iterable, Projection>::value,
std::conditional_t<
conditional_t<
Stability,
std::false_type,
decltype(detail::adl_despair{}(Sorter{}, iterable, std::move(projection)))
Expand All @@ -210,7 +209,7 @@ namespace cppsort
-> std::enable_if_t<
not detail::can_projection_sort<Sorter, Iterable, Projection>::value &&
detail::can_comparison_projection_sort<Sorter, Iterable, std::less<>, Projection>::value,
std::conditional_t<
conditional_t<
Stability,
std::false_type,
decltype(detail::adl_despair{}(Sorter{}, iterable,
Expand All @@ -236,7 +235,7 @@ namespace cppsort
Iterable,
detail::projection_compare<std::less<>, Projection>
>::value,
std::conditional_t<
conditional_t<
Stability,
std::false_type,
decltype(detail::adl_despair{}(Sorter{}, iterable,
Expand Down Expand Up @@ -265,7 +264,7 @@ namespace cppsort
Iterable,
detail::projection_compare<std::less<>, Projection>
>::value,
std::conditional_t<
conditional_t<
Stability,
cppsort::is_stable<Sorter(Iterable&, Projection)>,
decltype(cppsort::sort(Sorter{}, iterable, std::move(projection)))
Expand All @@ -284,7 +283,7 @@ namespace cppsort
auto operator()(Iterable& iterable, Compare compare, Projection projection) const
-> std::enable_if_t<
detail::can_comparison_projection_sort<Sorter, Iterable, Compare, Projection>::value,
std::conditional_t<
conditional_t<
Stability,
std::false_type,
decltype(detail::adl_despair{}(Sorter{}, iterable,
Expand All @@ -310,7 +309,7 @@ namespace cppsort
Iterable,
detail::projection_compare<Compare, Projection>
>::value,
std::conditional_t<
conditional_t<
Stability,
std::false_type,
decltype(detail::adl_despair{}(Sorter{}, iterable,
Expand Down Expand Up @@ -338,7 +337,7 @@ namespace cppsort
Iterable,
detail::projection_compare<Compare, Projection>
>::value,
std::conditional_t<
conditional_t<
Stability,
cppsort::is_stable<Sorter(Iterable&, Compare, Projection)>,
decltype(cppsort::sort(Sorter{}, iterable,
Expand All @@ -360,7 +359,7 @@ namespace cppsort
container_aware_adapter() = default;

// Automatic deduction guide
constexpr container_aware_adapter(Sorter) noexcept {}
constexpr explicit container_aware_adapter(Sorter) noexcept {}
};

////////////////////////////////////////////////////////////
Expand Down
9 changes: 3 additions & 6 deletions include/cpp-sort/adapters/counting_adapter.h
Expand Up @@ -27,10 +27,10 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <cstddef>
#include <functional>
#include <type_traits>
#include <utility>
#include <cpp-sort/fwd.h>
#include <cpp-sort/sorter_facade.h>
#include <cpp-sort/sorter_traits.h>
#include "../detail/checkers.h"
Expand Down Expand Up @@ -119,10 +119,7 @@ namespace cppsort
};
}

template<
typename ComparisonSorter,
typename CountType = std::size_t
>
template<typename ComparisonSorter, typename CountType>
struct counting_adapter:
sorter_facade<detail::counting_adapter_impl<
ComparisonSorter,
Expand All @@ -132,7 +129,7 @@ namespace cppsort
counting_adapter() = default;

// Automatic deduction guide
constexpr counting_adapter(ComparisonSorter) noexcept {}
constexpr explicit counting_adapter(ComparisonSorter) noexcept {}
};

////////////////////////////////////////////////////////////
Expand Down
7 changes: 3 additions & 4 deletions include/cpp-sort/adapters/hybrid_adapter.h
Expand Up @@ -34,7 +34,6 @@
#include <cpp-sort/sorter_facade.h>
#include <cpp-sort/sorter_traits.h>
#include "../detail/checkers.h"
#include "../detail/is_callable.h"
#include "../detail/iterator_traits.h"

namespace cppsort
Expand Down Expand Up @@ -119,7 +118,7 @@ namespace cppsort
template<typename... Args>
static auto _detail_stability(choice<Ind>, Args&&... args)
-> std::enable_if_t<
is_callable_v<Sorter(Args...)>,
is_invocable_v<Sorter, Args...>,
is_stable<Sorter(Args...)>
>;
};
Expand All @@ -129,7 +128,7 @@ namespace cppsort
// Adapter

template<typename... Sorters>
class hybrid_adapter:
struct hybrid_adapter:
public detail::check_iterator_category<Sorters...>,
public detail::check_is_always_stable<Sorters...>,
public sorter_facade_fptr<hybrid_adapter<Sorters...>>
Expand All @@ -139,7 +138,7 @@ namespace cppsort
hybrid_adapter() = default;

// Automatic deduction guide
constexpr hybrid_adapter(Sorters...) noexcept {};
constexpr explicit hybrid_adapter(Sorters...) noexcept {}

private:

Expand Down
2 changes: 1 addition & 1 deletion include/cpp-sort/adapters/indirect_adapter.h
Expand Up @@ -130,7 +130,7 @@ namespace cppsort
indirect_adapter() = default;

// Automatic deduction guide
constexpr indirect_adapter(Sorter) noexcept {}
constexpr explicit indirect_adapter(Sorter) noexcept {}
};

////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions include/cpp-sort/adapters/schwartz_adapter.h
Expand Up @@ -39,7 +39,7 @@
#include "../detail/associate_iterator.h"
#include "../detail/checkers.h"
#include "../detail/memory.h"
#include "../detail/remove_cvref.h"
#include "../detail/type_traits.h"

namespace cppsort
{
Expand Down Expand Up @@ -113,7 +113,7 @@ namespace cppsort
schwartz_adapter() = default;

// Automatic deduction guide
constexpr schwartz_adapter(Sorter) noexcept {}
constexpr explicit schwartz_adapter(Sorter) noexcept {}
};

////////////////////////////////////////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions include/cpp-sort/adapters/self_sort_adapter.h
Expand Up @@ -35,7 +35,7 @@
#include <cpp-sort/sorter_traits.h>
#include <cpp-sort/utility/as_function.h>
#include "../detail/checkers.h"
#include "../detail/detection.h"
#include "../detail/type_traits.h"

namespace cppsort
{
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace cppsort
self_sort_adapter() = default;

// Automatic deduction guide
constexpr self_sort_adapter(Sorter) noexcept {};
constexpr explicit self_sort_adapter(Sorter) noexcept {}

////////////////////////////////////////////////////////////
// Function call operator
Expand Down Expand Up @@ -149,10 +149,10 @@ namespace cppsort

template<typename Sorter, typename... Args>
struct is_stable<self_sort_adapter<Sorter>(Args...)>:
std::conditional_t<
detail::conditional_t<
detail::has_sort_method<Args...>,
std::false_type,
std::conditional_t<
detail::conditional_t<
detail::has_stable_sort_method<Args...>,
std::true_type,
is_stable<Sorter(Args...)>
Expand All @@ -167,7 +167,7 @@ namespace cppsort

template<typename Sorter, typename T, typename Function>
struct is_stable<self_sort_adapter<Sorter>(std::forward_list<T>&, Function)>:
std::conditional_t<
detail::conditional_t<
is_projection_v<Function, std::forward_list<T>&>,
is_stable<Sorter(std::forward_list<T>&, Function)>,
std::true_type
Expand All @@ -181,7 +181,7 @@ namespace cppsort

template<typename Sorter, typename T, typename Function>
struct is_stable<self_sort_adapter<Sorter>(std::list<T>&, Function)>:
std::conditional_t<
detail::conditional_t<
is_projection_v<Function, std::list<T>&>,
is_stable<Sorter(std::list<T>&, Function)>,
std::true_type
Expand Down
2 changes: 1 addition & 1 deletion include/cpp-sort/adapters/small_array_adapter.h
Expand Up @@ -33,8 +33,8 @@
#include <utility>
#include <cpp-sort/sorter_facade.h>
#include <cpp-sort/sorter_traits.h>
#include "../detail/detection.h"
#include "../detail/is_in_pack.h"
#include "../detail/type_traits.h"

namespace cppsort
{
Expand Down
4 changes: 2 additions & 2 deletions include/cpp-sort/adapters/stable_adapter.h
Expand Up @@ -168,7 +168,7 @@ namespace cppsort
make_stable() = default;

// Automatic deduction guide
constexpr make_stable(Sorter) noexcept {};
constexpr explicit make_stable(Sorter) noexcept {}
};

// Actual sorter
Expand All @@ -180,7 +180,7 @@ namespace cppsort
stable_adapter() = default;

// Automatic deduction guide
constexpr stable_adapter(Sorter) noexcept {}
constexpr explicit stable_adapter(Sorter) noexcept {}


template<
Expand Down
2 changes: 1 addition & 1 deletion include/cpp-sort/adapters/verge_adapter.h
Expand Up @@ -86,7 +86,7 @@ namespace cppsort
verge_adapter() = default;

// Automatic deduction guide
constexpr verge_adapter(FallbackSorter) noexcept {}
constexpr explicit verge_adapter(FallbackSorter) noexcept {}
};
}

Expand Down

0 comments on commit 3761f85

Please sign in to comment.