5 #include <boost/range/adaptor/map.hpp>
6 #include <boost/range/algorithm/copy.hpp>
7 #include <boost/variant.hpp>
26 std::ostream_iterator<std::string>(o,
" "));
27 raise(
"invalid ", kind,
": ", key,
", expected: ", o.str());
32 template <
typename Value>
37 using data_t = boost::variant<std::string, Value>;
38 using map_t = std::map<std::string, data_t>;
41 std::initializer_list<typename map_t::value_type> args)
51 auto i =
map_.find(s);
54 else if (
auto*
res = boost::get<value_t>(&i->second))
57 s = boost::get<std::string>(i->second);
std::map< std::string, data_t > map_t
std::string kind_
The nature of the selection. Used in error messages.
map_t map_
string -> (string | value).
const value_t & operator[](std::string s) const
The value associated to s.
boost::variant< std::string, Value > data_t
ATTRIBUTE_NORETURN void invalid_argument(const std::string &kind, const std::string &key, const C &map)
getarg(const std::string &kind, std::initializer_list< typename map_t::value_type > args)
auto map(const std::tuple< Ts... > &ts, Fun f) -> decltype(map_tuple_(f, ts, make_index_sequence< sizeof...(Ts)>()))
Map a function on a tuple, return tuple of the results.
auto copy(const AutIn &input, KeepState keep_state, KeepTrans keep_trans) -> decltype(keep_state(input->null_state()), keep_trans(input->null_transition()), make_fresh_automaton< AutIn, AutOut >(input))
A copy of input keeping only its states that are accepted by keep_state, and transitions accepted by ...
A mapping from strings to Values.