| 1 | /*! |
| 2 | @file |
| 3 | Forward declares `boost::hana::negate`. |
| 4 | |
| 5 | Copyright Louis Dionne 2013-2022 |
| 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) |
| 8 | */ |
| 9 | |
| 10 | #ifndef BOOST_HANA_FWD_NEGATE_HPP |
| 11 | #define BOOST_HANA_FWD_NEGATE_HPP |
| 12 | |
| 13 | #include <boost/hana/config.hpp> |
| 14 | #include <boost/hana/core/when.hpp> |
| 15 | |
| 16 | |
| 17 | namespace boost { namespace hana { |
| 18 | //! Return the inverse of an element of a group. |
| 19 | //! @ingroup group-Group |
| 20 | //! |
| 21 | //! |
| 22 | //! Example |
| 23 | //! ------- |
| 24 | //! @include example/negate.cpp |
| 25 | #ifdef BOOST_HANA_DOXYGEN_INVOKED |
| 26 | constexpr auto negate = [](auto&& x) -> decltype(auto) { |
| 27 | return tag-dispatched; |
| 28 | }; |
| 29 | #else |
| 30 | template <typename G, typename = void> |
| 31 | struct negate_impl : negate_impl<G, when<true>> { }; |
| 32 | |
| 33 | struct negate_t { |
| 34 | template <typename X> |
| 35 | constexpr decltype(auto) operator()(X&& x) const; |
| 36 | }; |
| 37 | |
| 38 | BOOST_HANA_INLINE_VARIABLE constexpr negate_t negate{}; |
| 39 | #endif |
| 40 | }} // end namespace boost::hana |
| 41 | |
| 42 | #endif // !BOOST_HANA_FWD_NEGATE_HPP |
| 43 | |