variant.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Boost.Geometry (aka GGL, Generic Geometry Library)
  2. // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
  3. // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
  4. // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
  5. // This file was modified by Oracle on 2018-2020.
  6. // Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
  7. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  8. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
  9. // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
  10. // Use, modification and distribution is subject to the Boost Software License,
  11. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  12. // http://www.boost.org/LICENSE_1_0.txt)
  13. #ifndef BOOST_GEOMETRY_GEOMETRIES_VARIANT_GEOMETRY_HPP
  14. #define BOOST_GEOMETRY_GEOMETRIES_VARIANT_GEOMETRY_HPP
  15. #include <boost/variant/variant_fwd.hpp>
  16. #include <boost/geometry/core/point_type.hpp>
  17. namespace boost { namespace geometry
  18. {
  19. namespace detail
  20. {
  21. template <typename ...>
  22. struct parameter_pack_first_type {};
  23. template <typename T, typename ... Ts>
  24. struct parameter_pack_first_type<T, Ts...>
  25. {
  26. typedef T type;
  27. };
  28. } // namespace detail
  29. template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
  30. struct point_type<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
  31. : point_type
  32. <
  33. typename detail::parameter_pack_first_type
  34. <
  35. BOOST_VARIANT_ENUM_PARAMS(T)
  36. >::type
  37. >
  38. {};
  39. }} // namespace boost::geometry
  40. #endif // BOOST_GEOMETRY_GEOMETRIES_VARIANT_GEOMETRY_HPP