mirror of
https://github.com/godotengine/godot.git
synced 2026-03-24 21:27:16 +00:00
Add is_zero_constructible to denote if a type can be semi-trivially constructed with all 0 bytes.
Optimize `CowData` and `LocalVector` resize for zero constructible types. Mark several compatible types as `is_zero_constructible`.
This commit is contained in:
@@ -652,6 +652,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// Zero-constructing String initializes _cowdata.ptr() to nullptr and thus empty.
|
||||
template <>
|
||||
struct is_zero_constructible<String> : std::true_type {};
|
||||
|
||||
bool operator==(const char *p_chr, const String &p_str);
|
||||
bool operator==(const wchar_t *p_chr, const String &p_str);
|
||||
bool operator!=(const char *p_chr, const String &p_str);
|
||||
|
||||
Reference in New Issue
Block a user