Wildmeshing Toolkit
attribute_ambiguous_error.cpp
Go to the documentation of this file.
1 
3 #include <fmt/format.h>
4 #include <fmt/ranges.h>
5 #include <algorithm>
6 #include <iterator>
7 #include "named_error_text.hpp"
9 
11  const AttributeDescription& ad,
12  const std::vector<AttributeDescription>& possibilities)
13 {
14  std::vector<std::string> names;
15 
16  std::string (*maker)(const AttributeDescription&) = make_named_error_string;
17  std::transform(possibilities.begin(), possibilities.end(), std::back_inserter(names), maker);
18  return fmt::format(
19  "Multiple options for an attribute {} found: [{}]",
21  fmt::join(names, ","));
22 }
23 } // namespace wmtk::components::multimesh::utils::detail
static std::string make_message(const AttributeDescription &description, const std::vector< AttributeDescription > &possibilities)
std::string make_named_error_string(const std::string_view &path, const std::optional< uint8_t > &dimension, const std::optional< attribute::AttributeType > &type)