default.hpp 781 B

1234567891011121314151617181920212223242526272829303132
  1. /*!
  2. @file
  3. Defines `boost::hana::default_` and `boost::hana::is_default`.
  4. Copyright Louis Dionne 2013-2022
  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_CORE_DEFAULT_HPP
  9. #define BOOST_HANA_CORE_DEFAULT_HPP
  10. #include <boost/hana/fwd/core/default.hpp>
  11. #include <boost/hana/config.hpp>
  12. #include <type_traits>
  13. namespace boost { namespace hana {
  14. template <typename Method, typename>
  15. struct is_default : std::false_type { };
  16. template <typename Method>
  17. struct is_default<Method, decltype((void)
  18. static_cast<default_>(*(Method*)0)
  19. )>
  20. : std::true_type
  21. { };
  22. }} // end namespace boost::hana
  23. #endif // !BOOST_HANA_CORE_DEFAULT_HPP