Skip to content
Snippets Groups Projects
Commit 95253a06 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] Reuse non-const impl. for const case

parent e0fcde4f
No related branches found
No related tags found
No related merge requests found
......@@ -123,20 +123,8 @@ template <typename T>
PropertyVector<T> const* Properties::getPropertyVector(
std::string_view name) const
{
auto it(_properties.find(std::string(name)));
if (it == _properties.end())
{
OGS_FATAL("The PropertyVector '{:s}' is not available in the mesh.",
name);
}
if (!dynamic_cast<PropertyVector<T> const*>(it->second))
{
OGS_FATAL(
"The PropertyVector '{:s}' has a different type than the requested "
"PropertyVector.",
name);
}
return dynamic_cast<PropertyVector<T> const*>(it->second);
return const_cast<PropertyVector<T> const*>(
const_cast<Properties*>(this)->getPropertyVector<T>(name));
}
template <typename T>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment