MCPcopy Create free account
hub / github.com/awslabs/aws-lambda-cpp / CanonicalizeForStdLibVersioning

Function CanonicalizeForStdLibVersioning

tests/gtest/gtest.h:3219–3229  ·  view source on GitHub ↗

Canonicalizes a given name with respect to the Standard C++ Library. This handles removing the inline namespace within `std` that is used by various standard libraries (e.g., `std::__1`). Names outside of namespace std are returned unmodified.

Source from the content-addressed store, hash-verified

3217// used by various standard libraries (e.g., `std::__1`). Names outside
3218// of namespace std are returned unmodified.
3219inline std::string CanonicalizeForStdLibVersioning(std::string s) {
3220 static const char prefix[] = "std::__";
3221 if (s.compare(0, strlen(prefix), prefix) == 0) {
3222 std::string::size_type end = s.find("::", strlen(prefix));
3223 if (end != s.npos) {
3224 // Erase everything between the initial `std` and the second `::`.
3225 s.erase(strlen("std"), end - strlen("std"));
3226 }
3227 }
3228 return s;
3229}
3230
3231// GetTypeName<T>() returns a human-readable name of type T.
3232// NB: This function is also used in Google Mock, so don't move it inside of

Callers 1

GetTypeNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected