MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
convert.hpp
Go to the documentation of this file.
1 #include <mbgl/util/util.hpp>
2 
3 #include <array>
4 #include <cstddef>
5 #include <type_traits>
6 
7 namespace mbgl {
8 namespace util {
9 
10 template<typename To, typename From, std::size_t Size,
11  typename = std::enable_if_t<std::is_convertible_v<From, To>>>
12 MBGL_CONSTEXPR std::array<To, Size> convert(const std::array<From, Size>&from) {
13  std::array<To, Size> to {{}};
14  std::copy(std::begin(from), std::end(from), std::begin(to));
15  return to;
16 }
17 
18 } // namespace util
19 } // namespace mbgl
MBGL_CONSTEXPR std::array< To, Size > convert(const std::array< From, Size > &from)
Definition: convert.hpp:12
Definition: actor.hpp:15
#define MBGL_CONSTEXPR
Definition: util.hpp:18