| 1 | /*! |
| 2 | @file |
| 3 | Documents the `BOOST_HANA_ADAPT_STRUCT` macro. |
| 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_ADAPT_STRUCT_HPP |
| 11 | #define BOOST_HANA_FWD_ADAPT_STRUCT_HPP |
| 12 | |
| 13 | #include <boost/hana/config.hpp> |
| 14 | |
| 15 | |
| 16 | namespace boost { namespace hana { |
| 17 | // Note: |
| 18 | // The weird definition as a variable seems to exploit a glitch in Doxygen |
| 19 | // which makes the macro appear in the related objects of Struct (as we |
| 20 | // want it to). |
| 21 | |
| 22 | //! Defines a model of `Struct` with the given members. |
| 23 | //! @ingroup group-Struct |
| 24 | //! |
| 25 | //! Using this macro at _global scope_ will define a model of the `Struct` |
| 26 | //! concept for the given type. This can be used to easily adapt existing |
| 27 | //! user-defined types in a ad-hoc manner. Unlike the |
| 28 | //! `BOOST_HANA_DEFINE_STRUCT` macro, this macro does not |
| 29 | //! require the types of the members to be specified. |
| 30 | //! |
| 31 | //! @note |
| 32 | //! This macro only works if the tag of the user-defined type `T` is `T` |
| 33 | //! itself. This is the case unless you specifically asked for something |
| 34 | //! different; see `tag_of`'s documentation. |
| 35 | //! |
| 36 | //! |
| 37 | //! Example |
| 38 | //! ------- |
| 39 | //! @include example/adapt_struct.cpp |
| 40 | #ifdef BOOST_HANA_DOXYGEN_INVOKED |
| 41 | auto BOOST_HANA_ADAPT_STRUCT(...) = ; |
| 42 | #define BOOST_HANA_ADAPT_STRUCT(Name, ...) see documentation |
| 43 | #else |
| 44 | // defined in <boost/hana/adapt_struct.hpp> |
| 45 | #endif |
| 46 | }} // end namespace boost::hana |
| 47 | |
| 48 | #endif // !BOOST_HANA_FWD_ADAPT_STRUCT_HPP |
| 49 | |