Replace compile-time polymorphism with runtime polymorphism in the conversion system

This commit is contained in:
John Firebaugh
2017-09-26 14:14:44 -07:00
parent bb58ddaea8
commit 4b2e1cddb4
60 changed files with 2435 additions and 2175 deletions

View File

@@ -0,0 +1,22 @@
#include <mbgl/style/conversion/position.hpp>
#include <mbgl/style/conversion/constant.hpp>
#include <array>
namespace mbgl {
namespace style {
namespace conversion {
optional<Position> Converter<Position>::operator()(const Convertible& value, Error& error) const {
optional<std::array<float, 3>> spherical = convert<std::array<float, 3>>(value, error);
if (!spherical) {
return {};
}
return Position(*spherical);
}
} // namespace conversion
} // namespace style
} // namespace mbgl