17 if (v.empty())
return {};
18 std::string
result = std::to_string(v.front());
19 for (
auto value : v | std::views::drop(1)){
20 result+= sep + std::to_string(value);
34 if (text.empty())
return;
35 const char *start = text.c_str();
36 const char *last = start+text.size();
37 static constexpr auto ok=std::errc{};
40 for (
const char * p=start;p<last;++p){
41 auto [ptr,ec] = std::from_chars(p, last,v);
43 if (ec != ok)
continue;
48 const std::string
msg =
"ExpandedIdentifier::set: '"+ text +
"' is not a valid input string.";
49 throw std::invalid_argument(
msg);
55ExpandedIdentifier::operator std::string ()
const{
static std::string show_vector(const ExpandedIdentifier::element_vector &v, const std::string &sep="/")
std::ostream & operator<<(std::ostream &out, const ExpandedIdentifier &x)
void set(const std::string &text)
build from a textual description
ExpandedIdentifier()=default
void add(element_type value)
Append a value into a new field.
boost::container::small_vector< element_type, 12 > element_vector
void clear()
Erase all fields.
void show() const
Send to std::cout.