You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Core: Add [[nodiscard]] to string-like classes
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#include "core/string/string_name.h"
|
||||
#include "core/string/ustring.h"
|
||||
|
||||
class NodePath {
|
||||
class [[nodiscard]] NodePath {
|
||||
struct Data {
|
||||
SafeRefCount refcount;
|
||||
Vector<StringName> path;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
class Main;
|
||||
|
||||
class StringName {
|
||||
class [[nodiscard]] StringName {
|
||||
struct Table;
|
||||
|
||||
struct _Data {
|
||||
|
||||
@@ -127,7 +127,7 @@ constexpr int64_t str_compare(const L *l_ptr, const R *r_ptr) {
|
||||
/*************************************************************************/
|
||||
|
||||
template <typename T>
|
||||
class CharProxy {
|
||||
class [[nodiscard]] CharProxy {
|
||||
friend String;
|
||||
friend CharStringT<T>;
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
/*************************************************************************/
|
||||
|
||||
template <typename T>
|
||||
class CharStringT {
|
||||
class [[nodiscard]] CharStringT {
|
||||
CowData<T> _cowdata;
|
||||
static constexpr T _null = 0;
|
||||
|
||||
@@ -265,7 +265,7 @@ using Char16String = CharStringT<char16_t>;
|
||||
/* String */
|
||||
/*************************************************************************/
|
||||
|
||||
class String {
|
||||
class [[nodiscard]] String {
|
||||
CowData<char32_t> _cowdata;
|
||||
static constexpr char32_t _null = 0;
|
||||
static constexpr char32_t _replacement_char = 0xfffd;
|
||||
|
||||
Reference in New Issue
Block a user