keys.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. @file
  3. Forward declares `boost::hana::keys`.
  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_KEYS_HPP
  9. #define BOOST_HANA_FWD_KEYS_HPP
  10. #include <boost/hana/config.hpp>
  11. #include <boost/hana/core/when.hpp>
  12. BOOST_HANA_NAMESPACE_BEGIN
  13. // Note: This function is documented per datatype/concept only.
  14. //! @cond
  15. template <typename T, typename = void>
  16. struct keys_impl : keys_impl<T, when<true>> { };
  17. //! @endcond
  18. struct keys_t {
  19. template <typename Map>
  20. constexpr auto operator()(Map&& map) const;
  21. };
  22. constexpr keys_t keys{};
  23. //! Returns a `Sequence` containing the name of the members of
  24. //! the data structure.
  25. //! @ingroup group-Struct
  26. //!
  27. //! Given a `Struct` object, `keys` returns a `Sequence` containing the
  28. //! name of all the members of the `Struct`, in the same order as they
  29. //! appear in the `accessors` sequence.
  30. //!
  31. //!
  32. //! Example
  33. //! -------
  34. //! @include example/struct/keys.cpp
  35. #ifdef BOOST_HANA_DOXYGEN_INVOKED
  36. constexpr auto keys = [](auto&& object) {
  37. return implementation_defined;
  38. };
  39. #endif
  40. BOOST_HANA_NAMESPACE_END
  41. #endif // !BOOST_HANA_FWD_KEYS_HPP