/
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/array.hpp
(3374B)
/*! @file Defines `boost::hana::detail::array`. @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_ARRAY_HPP #define BOOST_HANA_DETAIL_ARRAY_HPP #include <boost/hana/config.hpp> #include <boost/hana/detail/algorithm.hpp> #include <boost/hana/functional/placeholder.hpp> #include <cstddef> BOOST_HANA_NAMESPACE_BEGIN namespace detail { template <typename N> constexpr N factorial(N n) { N result = 1; while (n != 0) result *= n--; return result; } //! @ingroup group-details //! A minimal `std::array` with better `constexpr` support. //! //! We also provide some algorithms from the `constexpr/algorithm.hpp` //! header as member functions to make them easier to use in constexpr //! contexts, since a `constexpr` `array` can't be mutated in place. template <typename T, std::size_t Size> struct array { T elems_[Size > 0 ? Size : 1]; constexpr T& operator[](std::size_t n) { return elems_[n]; } constexpr T const& operator[](std::size_t n) const { return elems_[n]; } constexpr std::size_t size() const noexcept { return Size; } constexpr T* begin() noexcept { return elems_; } constexpr T const* begin() const noexcept { return elems_; } constexpr T* end() noexcept { return elems_ + Size; } constexpr T const* end() const noexcept { return elems_ + Size; } // Algorithms from constexpr/algorithm.hpp constexpr array reverse() const { array result = *this; detail::reverse(result.begin(), result.end()); return result; } template <typename BinaryPred> constexpr auto permutations(BinaryPred pred) const { array<array<T, Size>, detail::factorial(Size)> result{}; auto out = result.begin(); array copy = *this; do *out++ = copy; while (detail::next_permutation(copy.begin(), copy.end(), pred)); return result; } constexpr auto permutations() const { return this->permutations(hana::_ < hana::_); } template <typename BinaryPred> constexpr auto sort(BinaryPred pred) const { array result = *this; detail::sort(result.begin(), result.end(), pred); return result; } constexpr auto sort() const { return this->sort(hana::_ < hana::_); } template <typename U> constexpr auto iota(U value) const { array result = *this; detail::iota(result.begin(), result.end(), value); return result; } }; template <typename T, std::size_t M, typename U, std::size_t N> constexpr bool operator==(array<T, M> a, array<U, N> b) { return M == N && detail::equal(a.begin(), a.end(), b.begin(), b.end()); } template <typename T, std::size_t M, typename U, std::size_t N> constexpr bool operator<(array<T, M> a, array<U, N> b) { return M < N || detail::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end()); } } BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_DETAIL_ARRAY_HPP
Save
cmd:
run