1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
7 // This file was modified by Oracle on 2020.
8 // Modifications copyright (c) 2020, Oracle and/or its affiliates.
9 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
11 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
12 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
14 // Use, modification and distribution is subject to the Boost Software License,
15 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 #ifndef BOOST_GEOMETRY_CORE_TAG_CAST_HPP
19 #define BOOST_GEOMETRY_CORE_TAG_CAST_HPP
22 #include <type_traits>
25 namespace boost { namespace geometry
29 \brief Metafunction defining a type being either the specified tag, or one
30 of the specified basetags if the type inherits from them.
31 \details Tags can inherit each other. A multi_point inherits, for example,
32 both the multi_tag and the pointlike_tag. Often behaviour can be shared
33 between different geometry types. A tag, found by the metafunction tag,
34 can be casted to a more basic tag, and then dispatched by that tag.
36 \tparam Tag The tag to be casted to one of the base tags
37 \tparam BaseTags Base tags
39 \qbk{[include reference/core/tag_cast.qbk]}
41 template <typename Tag, typename ...BaseTags>
47 #ifndef DOXYGEN_NO_SPECIALIZATIONS
49 template <typename Tag, typename BaseTag, typename ...BaseTags>
50 struct tag_cast<Tag, BaseTag, BaseTags...>
52 typedef std::conditional_t
54 std::is_base_of<BaseTag, Tag>::value,
63 #endif // DOXYGEN_NO_SPECIALIZATIONS
66 }} // namespace boost::geometry
68 #endif // BOOST_GEOMETRY_CORE_TAG_CAST_HPP