TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ from_json() [11/19]

template<typename BasicJsonType , typename T , enable_if_t< is_getable< BasicJsonType, T >::value, int > = 0>
void nlohmann::detail::from_json ( const BasicJsonType &  j,
std::valarray< T > &  l 
)

Definition at line 4033 of file json.hpp.

4034{
4035 if (JSON_HEDLEY_UNLIKELY(!j.is_array()))
4036 {
4037 JSON_THROW(type_error::create(302, "type must be array, but is " + std::string(j.type_name()), j));
4038 }
4039
4040 l.resize(j.size());
4041 std::transform(j.begin(), j.end(), std::begin(l),
4042 [](const BasicJsonType & elem)
4043 {
4044 return elem.template get<T>();
4045 });
4046}