1#ifndef MAPBOX_UTIL_VARIANT_VISITOR_HPP
2#define MAPBOX_UTIL_VARIANT_VISITOR_HPP
3
4namespace mapbox {
5namespace util {
6
7template <typename... Fns>
8struct visitor;
9
10template <typename Fn>
11struct visitor<Fn> : Fn
12{
13 using type = Fn;
14 using Fn::operator();
15
16 visitor(Fn fn) : Fn(fn) {}
17};
18
19template <typename Fn, typename... Fns>
20struct visitor<Fn, Fns...> : Fn, visitor<Fns...>
21{
22 using type = visitor;
23 using Fn::operator();
24 using visitor<Fns...>::operator();
25
26 visitor(Fn fn, Fns... fns) : Fn(fn), visitor<Fns...>(fns...) {}
27};
28
29template <typename... Fns>
30visitor<Fns...> make_visitor(Fns... fns)
31{
32 return visitor<Fns...>(fns...);
33}
34
35} // namespace util
36} // namespace mapbox
37
38#endif // MAPBOX_UTIL_VARIANT_VISITOR_HPP
39

source code of qtlocation/src/3rdparty/mapbox-gl-native/deps/variant/1.1.4/include/mapbox/variant_visitor.hpp