Guest User

Untitled

a guest
Jul 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. struct validate_set
  2. {
  3. std::string_view key;
  4. span<std::string_view> allowed_values;
  5. };
  6.  
  7. constexpr std::array allowedValues{
  8. validate_set{ "foo"sv, { "bar"sv, "baz"sv } },
  9. validate_set{ "hello"sv, { "world"sv } }
  10. };
  11.  
  12. constexpr std::array allowedValues{
  13. validate_set{ "foo"sv, "barbaz"sv },
  14. validate_set{ "hello"sv, "world"sv }
  15. };
  16.  
  17. constexpr std::initializer_list list0 = { "bar"sv, "baz"sv };
  18. constexpr std::initializer_list list1 = { "world"sv };
  19. constexpr std::array allowedValues{
  20. validate_set{ "foo"sv, list0 },
  21. validate_set{ "hello"sv, list1 }
  22. };
Add Comment
Please, Sign In to add comment