define_struct.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*!
  2. @file
  3. Documents the `BOOST_HANA_DEFINE_STRUCT` macro.
  4. @copyright Louis Dionne 2013-2017
  5. Distributed under the Boost Software License, Version 1.0.
  6. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  7. */
  8. #ifndef BOOST_HANA_FWD_DEFINE_STRUCT_HPP
  9. #define BOOST_HANA_FWD_DEFINE_STRUCT_HPP
  10. #include <boost/hana/config.hpp>
  11. BOOST_HANA_NAMESPACE_BEGIN
  12. // Note:
  13. // The weird definition as a variable seems to exploit a glitch in Doxygen
  14. // which makes the macro appear in the related objects of Struct (as we
  15. // want it to).
  16. //! Defines members of a structure, while at the same time
  17. //! modeling `Struct`.
  18. //! @ingroup group-Struct
  19. //!
  20. //! Using this macro in the body of a user-defined type will define the
  21. //! given members inside that type, and will also provide a model of the
  22. //! `Struct` concept for that user-defined type. This macro is often the
  23. //! easiest way to define a model of the `Struct` concept.
  24. //!
  25. //! @note
  26. //! This macro only works if the tag of the user-defined type `T` is `T`
  27. //! itself. This is the case unless you specifically asked for something
  28. //! different; see `tag_of`'s documentation.
  29. //!
  30. //!
  31. //! Example
  32. //! -------
  33. //! @include example/define_struct.cpp
  34. #ifdef BOOST_HANA_DOXYGEN_INVOKED
  35. auto BOOST_HANA_DEFINE_STRUCT(...) = ;
  36. #define BOOST_HANA_DEFINE_STRUCT(Name, ...) see documentation
  37. #else
  38. // defined in <boost/hana/define_struct.hpp>
  39. #endif
  40. BOOST_HANA_NAMESPACE_END
  41. #endif // !BOOST_HANA_FWD_DEFINE_STRUCT_HPP