StdComplex.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <complex>
7 #include <utility>
8 
9 #include "Options/Options.hpp"
10 
11 /// Parse complex numbers as pairs of doubles.
12 template <>
13 struct Options::create_from_yaml<std::complex<double>> {
14  template <typename Metavariables>
15  static std::complex<double> create(const Options::Option& options) {
16  const auto pair_of_doubles = options.parse_as<std::pair<double, double>>();
17  return std::complex<double>(pair_of_doubles.first, pair_of_doubles.second);
18  }
19 };
utility
std::pair< double, double >
Options.hpp
Options::Option
Definition: Options.hpp:108
Options::create_from_yaml
Definition: MinmodType.hpp:11
complex