Fixed ScriptValue::mapView() for const ScriptValues.
This commit is contained in:
@@ -81,6 +81,9 @@ public:
|
|||||||
template<typename TMap>
|
template<typename TMap>
|
||||||
MapView(TMap& map) -> MapView<typename TMap::key_type, typename TMap::mapped_type, TMap>;
|
MapView(TMap& map) -> MapView<typename TMap::key_type, typename TMap::mapped_type, TMap>;
|
||||||
|
|
||||||
|
template<typename TMap>
|
||||||
|
MapView(const TMap& map) -> MapView<typename TMap::key_type, const typename TMap::mapped_type, const TMap>;
|
||||||
|
|
||||||
//
|
//
|
||||||
// public functions
|
// public functions
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -324,10 +324,10 @@ public:
|
|||||||
return std::get<map_t>(base_).values;
|
return std::get<map_t>(base_).values;
|
||||||
}
|
}
|
||||||
|
|
||||||
MapView<std::string, const concrete_t> mapView() const MIJIN_NOEXCEPT
|
auto mapView() const MIJIN_NOEXCEPT
|
||||||
{
|
{
|
||||||
MIJIN_ASSERT_FATAL(isMap(), "Called iterateMap() on a non-map value.");
|
MIJIN_ASSERT_FATAL(isMap(), "Called iterateMap() on a non-map value.");
|
||||||
return std::get<map_t>(base_).values;
|
return MapView(std::get<map_t>(base_).values);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user