11 #include <unordered_map>
16 [[nodiscard]] std::string_view
19 static std::unordered_map<Linkage, std::string_view> strings = {
33 if (
const auto it = strings.find(linkage); it != strings.end())
36 throw std::logic_error(
37 "Unknown linkage type: "
38 + std::to_string(
static_cast<std::underlying_type_t<Linkage>
>(linkage)));
44 static std::unordered_map<std::string_view, Linkage> linkages = {
58 if (
const auto it = linkages.find(stringValue); it != linkages.end())
61 throw std::logic_error(
"Unknown linkage type: " + std::string(stringValue));
Global memory state passed between functions.
std::string_view linkageToString(const Linkage linkage)
@ availableExternallyLinkage
Linkage linkageFromString(const std::string_view stringValue)