mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
Recommend avoiding the List datatype in C++ usage guidelines
(cherry picked from commit e82b433b6d)
This commit is contained in:
committed by
Rémi Verschelde
parent
872f7aeb95
commit
327fb07ba1
@@ -56,10 +56,16 @@ This means that pull requests should **not** use ``std::string``,
|
||||
``std::vector`` and the like. Instead, use Godot's datatypes as described below:
|
||||
|
||||
- Use ``String`` instead of ``std::string``.
|
||||
- Use ``Vector`` instead of ``std::vector``. In some cases, ``List`` or
|
||||
``LocalVector`` can be used as an alternative (ask core developers first).
|
||||
- Use ``Vector`` instead of ``std::vector``. In some cases, ``LocalVector``
|
||||
can be used as an alternative (ask core developers first).
|
||||
- Use ``Array`` instead of ``std::array``.
|
||||
|
||||
.. note::
|
||||
|
||||
Godot also has a List datatype (which is a linked list). While List is already used
|
||||
in the codebase, it typically performs worse than other datatypes like Vector
|
||||
and Array. Therefore, List should be avoided in new code unless necessary.
|
||||
|
||||
``auto`` keyword
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user