1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #111223 from Ivorforce/remove-iterator-include

Replace `std::size` usage with `std_size` to avoid `<iterator>` include.
This commit is contained in:
Thaddeus Crews
2025-10-06 09:06:49 -05:00
39 changed files with 67 additions and 66 deletions

View File

@@ -4241,7 +4241,7 @@ GDScriptParser::ParseRule *GDScriptParser::get_rule(GDScriptTokenizer::Token::Ty
};
/* clang-format on */
// Avoid desync.
static_assert(std::size(rules) == GDScriptTokenizer::Token::TK_MAX, "Amount of parse rules don't match the amount of token types.");
static_assert(std_size(rules) == GDScriptTokenizer::Token::TK_MAX, "Amount of parse rules don't match the amount of token types.");
// Let's assume this is never invalid, since nothing generates a TK_MAX.
return &rules[p_token_type];

View File

@@ -158,7 +158,7 @@ static const char *token_names[] = {
};
// Avoid desync.
static_assert(std::size(token_names) == GDScriptTokenizer::Token::TK_MAX, "Amount of token names don't match the amount of token types.");
static_assert(std_size(token_names) == GDScriptTokenizer::Token::TK_MAX, "Amount of token names don't match the amount of token types.");
const char *GDScriptTokenizer::Token::get_name() const {
ERR_FAIL_INDEX_V_MSG(type, TK_MAX, "<error>", "Using token type out of the enum.");

View File

@@ -411,7 +411,7 @@ void (*type_init_function_table[])(Variant *) = {
&&OPCODE_LINE, \
&&OPCODE_END \
}; \
static_assert(std::size(switch_table_ops) == (OPCODE_END + 1), "Opcodes in jump table aren't the same as opcodes in enum.");
static_assert(std_size(switch_table_ops) == (OPCODE_END + 1), "Opcodes in jump table aren't the same as opcodes in enum.");
#define OPCODE(m_op) \
m_op:

View File

@@ -248,7 +248,7 @@ String GDScriptWarning::get_name_from_code(Code p_code) {
#endif
};
static_assert(std::size(names) == WARNING_MAX, "Amount of warning types don't match the amount of warning names.");
static_assert(std_size(names) == WARNING_MAX, "Amount of warning types don't match the amount of warning names.");
return names[(int)p_code];
}

View File

@@ -155,7 +155,7 @@ public:
#endif
};
static_assert(std::size(default_warning_levels) == WARNING_MAX, "Amount of default levels does not match the amount of warnings.");
static_assert(std_size(default_warning_levels) == WARNING_MAX, "Amount of default levels does not match the amount of warnings.");
Code code = WARNING_MAX;
int start_line = -1, end_line = -1;