MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / throwIfNotKind

Method throwIfNotKind

docopt_value.h:92–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 void throwIfNotKind(Kind expected) const {
93 if (kind_ == expected)
94 return;
95
96 std::string error = "Illegal cast to ";
97 error += kindAsString(expected);
98 error += "; type is actually ";
99 error += kindAsString(kind_);
100 throw std::runtime_error(std::move(error));
101 }
102
103 Kind kind_ = Kind::Empty;
104 Variant variant_ {};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected