Files
MapLibreParticleLab/include/mbgl/util/convert.hpp
Bart Louwers 71f6da2722 Add clang-format (#1086)
Co-authored-by: mwilsnd <mwilsnd@gmail.com>
2023-05-01 16:57:37 +02:00

19 lines
482 B
C++

#include <mbgl/util/util.hpp>
#include <array>
#include <cstddef>
#include <type_traits>
namespace mbgl {
namespace util {
template <typename To, typename From, std::size_t Size, typename = std::enable_if_t<std::is_convertible_v<From, To>>>
MBGL_CONSTEXPR std::array<To, Size> convert(const std::array<From, Size>& from) {
std::array<To, Size> to{{}};
std::copy(std::begin(from), std::end(from), std::begin(to));
return to;
}
} // namespace util
} // namespace mbgl