OGS
nextUnusedMaterialId.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <range/v3/algorithm/max.hpp>
7
9
10namespace MeshLib
11{
14inline int nextUnusedMaterialId(PropertyVector<int> const& material_ids)
15{
16 return material_ids.empty() ? 0 : ranges::max(material_ids) + 1;
17}
18} // namespace MeshLib
constexpr bool empty() const
int nextUnusedMaterialId(PropertyVector< int > const &material_ids)