File indexing completed on 2025-01-18 09:37:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_HANA_DETAIL_OPERATORS_SEARCHABLE_HPP
0011 #define BOOST_HANA_DETAIL_OPERATORS_SEARCHABLE_HPP
0012
0013 #include <boost/hana/config.hpp>
0014 #include <boost/hana/fwd/at_key.hpp>
0015
0016
0017 namespace boost { namespace hana { namespace detail {
0018 template <typename Derived>
0019 struct searchable_operators {
0020 template <typename Key>
0021 constexpr decltype(auto) operator[](Key&& key) & {
0022 return hana::at_key(static_cast<Derived&>(*this),
0023 static_cast<Key&&>(key));
0024 }
0025
0026 template <typename Key>
0027 constexpr decltype(auto) operator[](Key&& key) && {
0028 return hana::at_key(static_cast<Derived&&>(*this),
0029 static_cast<Key&&>(key));
0030 }
0031
0032 template <typename Key>
0033 constexpr decltype(auto) operator[](Key&& key) const& {
0034 return hana::at_key(static_cast<Derived const&>(*this),
0035 static_cast<Key&&>(key));
0036 }
0037 };
0038 } }}
0039
0040 #endif