3 Defines operators for Iterables.
5 @copyright Louis Dionne 2013-2017
6 Distributed under the Boost Software License, Version 1.0.
7 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
10 #ifndef BOOST_HANA_DETAIL_OPERATORS_ITERABLE_HPP
11 #define BOOST_HANA_DETAIL_OPERATORS_ITERABLE_HPP
13 #include <boost/hana/config.hpp>
14 #include <boost/hana/fwd/at.hpp>
17 namespace boost { namespace hana { namespace detail {
18 template <typename Derived>
19 struct iterable_operators {
21 constexpr decltype(auto) operator[](N&& n) & {
22 return hana::at(static_cast<Derived&>(*this),
27 constexpr decltype(auto) operator[](N&& n) const& {
28 return hana::at(static_cast<Derived const&>(*this),
33 constexpr decltype(auto) operator[](N&& n) && {
34 return hana::at(static_cast<Derived&&>(*this),
38 } }} // end namespace boost::hana
40 #endif // !BOOST_HANA_DETAIL_OPERATORS_ITERABLE_HPP