/
usr
/
include
/
boost
/
hana
/
detail
/
/usr/include/boost/hana/detail
mkdir
upload
Name
Size
Mode
Actions
operators/
-
0755
rm
variadic/
-
0755
rm
algorithm.hpp
5973
0644
edit
dl
rm
any_of.hpp
1380
0644
edit
dl
rm
array.hpp
3374
0644
edit
dl
rm
canonical_constant.hpp
2700
0644
edit
dl
rm
concepts.hpp
3019
0644
edit
dl
rm
create.hpp
935
0644
edit
dl
rm
decay.hpp
1715
0644
edit
dl
rm
dispatch_if.hpp
2082
0644
edit
dl
rm
ebo.hpp
3874
0644
edit
dl
rm
fast_and.hpp
600
0644
edit
dl
rm
first_unsatisfied_index.hpp
1731
0644
edit
dl
rm
hash_table.hpp
5487
0644
edit
dl
rm
has_common_embedding.hpp
2473
0644
edit
dl
rm
has_duplicates.hpp
2337
0644
edit
dl
rm
index_if.hpp
1610
0644
edit
dl
rm
integral_constant.hpp
10052
0644
edit
dl
rm
intrinsics.hpp
1984
0644
edit
dl
rm
nested_by.hpp
1255
0644
edit
dl
rm
nested_by_fwd.hpp
1990
0644
edit
dl
rm
nested_than.hpp
854
0644
edit
dl
rm
nested_than_fwd.hpp
1624
0644
edit
dl
rm
nested_to.hpp
788
0644
edit
dl
rm
nested_to_fwd.hpp
1627
0644
edit
dl
rm
preprocessor.hpp
1435
0644
edit
dl
rm
std_common_type.hpp
1085
0644
edit
dl
rm
struct_macros.hpp
798577
0644
edit
dl
rm
type_at.hpp
1594
0644
edit
dl
rm
type_foldl1.hpp
3916
0644
edit
dl
rm
type_foldr1.hpp
3903
0644
edit
dl
rm
unpack_flatten.hpp
2416
0644
edit
dl
rm
void_t.hpp
518
0644
edit
dl
rm
wrong.hpp
861
0644
edit
dl
rm
Edit:
/usr/include/boost/hana/detail/algorithm.hpp
(5973B)
/*! @file Defines several `constexpr` algorithms. @copyright Louis Dionne 2013-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_DETAIL_ALGORITHM_HPP #define BOOST_HANA_DETAIL_ALGORITHM_HPP #include <boost/hana/functional/placeholder.hpp> #include <boost/hana/config.hpp> #include <cstddef> #include <utility> BOOST_HANA_NAMESPACE_BEGIN namespace detail { // Do not call this swap, otherwise it can get picked up by ADL and conflict // with std::swap (see https://github.com/boostorg/hana/issues/297). template <typename T> constexpr void constexpr_swap(T& x, T& y) { auto tmp = x; x = y; y = std::move(tmp); } template <typename BidirIter> constexpr void reverse(BidirIter first, BidirIter last) { while (first != last) { if (first == --last) break; detail::constexpr_swap(*first, *last); ++first; } } template <typename BidirIter, typename BinaryPred> constexpr bool next_permutation(BidirIter first, BidirIter last, BinaryPred pred) { BidirIter i = last; if (first == last || first == --i) return false; while (true) { BidirIter ip1 = i; if (pred(*--i, *ip1)) { BidirIter j = last; while (!pred(*i, *--j)) ; detail::constexpr_swap(*i, *j); detail::reverse(ip1, last); return true; } if (i == first) { detail::reverse(first, last); return false; } } } template <typename BidirIter> constexpr bool next_permutation(BidirIter first, BidirIter last) { return detail::next_permutation(first, last, hana::_ < hana::_); } template <typename InputIter1, typename InputIter2, typename BinaryPred> constexpr bool lexicographical_compare(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, BinaryPred pred) { for (; first2 != last2; ++first1, ++first2) { if (first1 == last1 || pred(*first1, *first2)) return true; else if (pred(*first2, *first1)) return false; } return false; } template <typename InputIter1, typename InputIter2> constexpr bool lexicographical_compare(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2) { return detail::lexicographical_compare(first1, last1, first2, last2, hana::_ < hana::_); } template <typename InputIter1, typename InputIter2, typename BinaryPred> constexpr bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2, BinaryPred pred) { for (; first1 != last1 && first2 != last2; ++first1, ++first2) if (!pred(*first1, *first2)) return false; return first1 == last1 && first2 == last2; } template <typename InputIter1, typename InputIter2> constexpr bool equal(InputIter1 first1, InputIter1 last1, InputIter2 first2, InputIter2 last2) { return detail::equal(first1, last1, first2, last2, hana::_ == hana::_); } template <typename BidirIter, typename BinaryPred> constexpr void sort(BidirIter first, BidirIter last, BinaryPred pred) { if (first == last) return; BidirIter i = first; for (++i; i != last; ++i) { BidirIter j = i; auto t = *j; for (BidirIter k = i; k != first && pred(t, *--k); --j) *j = *k; *j = t; } } template <typename BidirIter> constexpr void sort(BidirIter first, BidirIter last) { detail::sort(first, last, hana::_ < hana::_); } template <typename InputIter, typename T> constexpr InputIter find(InputIter first, InputIter last, T const& value) { for (; first != last; ++first) if (*first == value) return first; return last; } template <typename InputIter, typename UnaryPred> constexpr InputIter find_if(InputIter first, InputIter last, UnaryPred pred) { for (; first != last; ++first) if (pred(*first)) return first; return last; } template <typename ForwardIter, typename T> constexpr void iota(ForwardIter first, ForwardIter last, T value) { while (first != last) { *first++ = value; ++value; } } template <typename InputIt, typename T> constexpr std::size_t count(InputIt first, InputIt last, T const& value) { std::size_t n = 0; for (; first != last; ++first) if (*first == value) ++n; return n; } template <typename InputIt, typename T, typename F> constexpr T accumulate(InputIt first, InputIt last, T init, F f) { for (; first != last; ++first) init = f(init, *first); return init; } template <typename InputIt, typename T> constexpr T accumulate(InputIt first, InputIt last, T init) { return detail::accumulate(first, last, init, hana::_ + hana::_); } template <typename ForwardIt> constexpr ForwardIt min_element(ForwardIt first, ForwardIt last) { if (first == last) return last; ForwardIt smallest = first; ++first; for (; first != last; ++first) if (*first < *smallest) smallest = first; return smallest; } } BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_DETAIL_ALGORITHM_HPP
Save
cmd:
run