Václav Kubernát | 3a99f00 | 2020-03-31 02:27:41 +0200 | [diff] [blame] | 1 | #include <algorithm> |
Václav Kubernát | 385dcdd | 2020-11-25 17:46:54 +0100 | [diff] [blame] | 2 | #include "ast_values.hpp" |
Václav Kubernát | 3a99f00 | 2020-03-31 02:27:41 +0200 | [diff] [blame] | 3 | #include "leaf_data_type.hpp" |
| 4 | yang::Enum createEnum(const std::initializer_list<const char*>& list) |
| 5 | { |
| 6 | std::set<enum_> enums; |
| 7 | std::transform(list.begin(), list.end(), std::inserter(enums, enums.end()), [](const auto& value) { |
| 8 | return enum_{value}; |
| 9 | }); |
| 10 | return yang::Enum(std::move(enums)); |
| 11 | } |