3 Forward declares `boost::hana::is_a` and `boost::hana::is_an`.
5 @copyright Louis Dionne 2013-2016
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)
10 #ifndef BOOST_HANA_FWD_CORE_IS_A_HPP
11 #define BOOST_HANA_FWD_CORE_IS_A_HPP
13 #include <boost/hana/config.hpp>
16 BOOST_HANA_NAMESPACE_BEGIN
17 //! @ingroup group-core
18 //! Returns whether the tag of an object matches a given tag.
20 //! Given a tag `Tag` and a C++ type `T`, `is_a<Tag, T>` is a compile-time
21 //! Logical representing whether the tag of `T` is exactly `Tag`. In other
22 //! words, it is equivalent to
24 //! std::is_same<Tag, tag_of<T>::type>
27 //! For convenience, an alternate syntax is provided for using `is_a`.
28 //! Specifically, `is_a<Tag>` is a function object returning whether the
29 //! argument it is passed has the given tag. In other words,
31 //! is_a<Tag>(x) == is_a<Tag, decltype(x)>
37 //! @include example/core/is_a.cpp
38 #ifdef BOOST_HANA_DOXYGEN_INVOKED
39 template <typename Tag, typename optional_T>
40 constexpr auto is_a = see-documentation;
42 template <typename Tag, typename ...T>
45 template <typename Tag, typename ...T>
46 constexpr is_a_t<Tag, T...> is_a{};
49 //! @ingroup group-core
50 //! Equivalent to `is_a`; provided for consistency with the rules of the
52 #ifdef BOOST_HANA_DOXYGEN_INVOKED
53 template <typename Tag, typename ...T>
54 constexpr auto is_an = is_a<Tag, T...>;
56 template <typename Tag, typename ...T>
57 constexpr is_a_t<Tag, T...> is_an{};
59 BOOST_HANA_NAMESPACE_END
61 #endif // !BOOST_HANA_FWD_CORE_IS_A_HPP