fwd.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Copyright Antony Polukhin, 2021-2025.
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See
  4. // accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. // Contributed by Ruslan Arutyunyan
  7. #ifndef BOOST_ANY_ANYS_FWD_HPP
  8. #define BOOST_ANY_ANYS_FWD_HPP
  9. #include <boost/any/detail/config.hpp>
  10. #if !defined(BOOST_USE_MODULES) || defined(BOOST_ANY_INTERFACE_UNIT)
  11. #ifndef BOOST_ANY_INTERFACE_UNIT
  12. #include <boost/config.hpp>
  13. #ifdef BOOST_HAS_PRAGMA_ONCE
  14. # pragma once
  15. #endif
  16. #endif // #ifndef BOOST_ANY_INTERFACE_UNIT
  17. /// \file boost/any/fwd.hpp
  18. /// \brief Forward declarations of Boost.Any library types.
  19. /// @cond
  20. namespace boost {
  21. BOOST_ANY_BEGIN_MODULE_EXPORT
  22. class any;
  23. BOOST_ANY_END_MODULE_EXPORT
  24. namespace anys {
  25. BOOST_ANY_BEGIN_MODULE_EXPORT
  26. class unique_any;
  27. template<std::size_t OptimizeForSize = sizeof(void*), std::size_t OptimizeForAlignment = alignof(void*)>
  28. class basic_any;
  29. BOOST_ANY_END_MODULE_EXPORT
  30. namespace detail {
  31. template <class T>
  32. struct is_basic_any: public std::false_type {};
  33. template<std::size_t OptimizeForSize, std::size_t OptimizeForAlignment>
  34. struct is_basic_any<boost::anys::basic_any<OptimizeForSize, OptimizeForAlignment> > : public std::true_type {};
  35. template <class T>
  36. struct is_some_any: public is_basic_any<T> {};
  37. template <>
  38. struct is_some_any<boost::any>: public std::true_type {};
  39. template <>
  40. struct is_some_any<boost::anys::unique_any>: public std::true_type {};
  41. } // namespace detail
  42. } // namespace anys
  43. } // namespace boost
  44. /// @endcond
  45. #endif // #if !defined(BOOST_USE_MODULES) || defined(BOOST_ANY_INTERFACE_UNIT)
  46. #endif // #ifndef BOOST_ANY_ANYS_FWD_HPP