47 std::map<
int, std::shared_ptr<T>>& media,
48 std::vector<int>
const& material_ids_of_this_medium,
49 CreateMedium&& create_medium)
51 if (media.find(
id) != end(media))
54 "Multiple media were specified for the same material id '{:d}'. "
55 "Keep in mind, that if no material id is specified, it is assumed "
56 "to be 0 by default.",
60 if (
id == material_ids_of_this_medium[0])
62 media[id] = create_medium(
id);
66 media[id] = media[material_ids_of_this_medium[0]];