OGS
Properties-impl.h File Reference

Detailed Description

Implemenatiom of the template part of the class Properties.

Definition in file Properties-impl.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename Function >
void applyToPropertyVectors (Properties const &properties, Function f)
 

Function Documentation

◆ applyToPropertyVectors()

template<typename Function >
void applyToPropertyVectors ( Properties const & properties,
Function f )

Definition at line 244 of file Properties-impl.h.

245{
246 for (auto [name, property] : properties)
247 {
248 // Open question, why is the 'unsigned long' case not compiling giving
249 // an error "expected '(' for function-style cast or type construction"
250 // with clang-7, and "error C4576: a parenthesized type followed by an
251 // initializer list is a non-standard explicit type conversion syntax"
252 // with MSVC-15.
253 bool success = f(double{}, property) || f(float{}, property) ||
254 f(int{}, property) || f(unsigned{}, property) ||
255 f(long{}, property) ||
256 f(static_cast<unsigned long>(0), property) ||
257 f(std::size_t{}, property) || f(char{}, property) ||
258 f(static_cast<unsigned char>(0), property);
259 if (!success)
260 {
261 OGS_FATAL("Could not apply function to PropertyVector '{:s}'.",
262 property->getPropertyName());
263 }
264 }
265}
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

Referenced by main(), ApplicationUtils::partitionProperties(), and ApplicationUtils::writeProperties().