Skip to content

Commit

Permalink
Add a _str UDL for SafeString and WSafeString
Browse files Browse the repository at this point in the history
For convenience.
  • Loading branch information
leoetlino committed Apr 24, 2024
1 parent 7e78702 commit ead821d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/prim/seadSafeString.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,24 @@ inline bool operator>=(const SafeString& lhs, const SafeString& rhs)
return lhs.compare(rhs) >= 0;
}

inline namespace literals
{
inline namespace str
{

inline SafeString operator""_str(const char* str, std::size_t /*len*/)
{
return str;
}

inline WSafeString operator""_str(const char16* str, std::size_t /*len*/)
{
return str;
}

} // namespace str
} // namespace literals

} // namespace sead

#define SEAD_PRIM_SAFE_STRING_H_
Expand Down

0 comments on commit ead821d

Please sign in to comment.