{ "format": 1, "id": "saw-string_literal", "kind": "class", "name": "string_literal", "namespace": "saw", "module": "core", "header": "modules/core/c++/string_literal.hpp", "brief_description": "Helper object which turns a string literal into a template parameter.", "detailed_description": [ [ "It guarantees compile time uniqueness and thus allows using strings in template parameters. Everything in this codebase which is addressed by name rests on it: struct members, interface functions, and the schema hashes derived from them." ], [ "Because the length is part of the type, two literals of different length are different types, and comparing them is a compile time false rather than an error." ] ], "templates": [ {"name": "CharT", "kind": "type"}, {"name": "N", "kind": "non_type", "type": "size_t", "brief_description": "Length including the null terminator."} ], "attributes": { "saw-string_literal-data": { "id": "saw-string_literal-data", "name": "data", "type": ["std::array< CharT, N >"], "visibility": "public" } }, "functions": { "saw-string_literal-ctor": { "id": "saw-string_literal-ctor", "name": "string_literal", "type": [], "brief_description": "From a literal. Copies it character by character so the whole thing is constexpr.", "parameters": [ {"name": "input", "type": ["const CharT (&)[N]"]} ] }, "saw-string_literal-view": { "id": "saw-string_literal-view", "name": "view", "type": ["std::string_view"], "const": true, "brief_description": "The literal as a view, for the places which compare against runtime strings." }, "saw-string_literal-eq": { "id": "saw-string_literal-eq", "name": "operator==", "type": ["bool"], "const": true, "brief_description": "Equality. A literal of different length is never equal.", "parameters": [ {"name": "rhs", "type": ["const string_literal< CharTR, NR > &"]} ] }, "saw-string_literal-plus": { "id": "saw-string_literal-plus", "name": "operator+", "type": ["string_literal< CharT, N+NR-1 >"], "const": true, "brief_description": "Concatenation, dropping the null terminator of the left side.", "templates": [ {"name": "NR", "kind": "non_type", "type": "size_t"} ], "parameters": [ {"name": "rhs", "type": ["const string_literal< CharT, NR > &"]} ] } }, "notes": [ "The literal operator \"\"_sl builds one from a quoted string." ] }