NeoFOAM
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
input.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// SPDX-FileCopyrightText: 2023 NeoFOAM authors
3#pragma once
4
5#include <variant>
6
9
10namespace NeoFOAM
11{
12
13using Input = std::variant<Dictionary, TokenList>;
14
15template<class DataClass>
16DataClass read(Input input)
17{
18 return std::visit([](const auto& i) { return DataClass::read(i); }, input);
19}
20
21}
DataClass read(Input input)
Definition input.hpp:16
std::variant< Dictionary, TokenList > Input
Definition input.hpp:13