@@ -142,7 +142,7 @@ scripting API.
142
142
| Godot datatype | Closest C++ STL datatype | Comment |
143
143
+=======================+==========================+=======================================================================================+
144
144
| |string | 📜 | ``std::string `` | **Use this as the "default" string type. ** ``String `` uses UTF-32 encoding |
145
- | | | to improve performance thanks to its fixed character size. |
145
+ | | | to simplify processing thanks to its fixed character size. |
146
146
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
147
147
| |vector | | ``std::vector `` | **Use this as the "default" vector type. ** Uses copy-on-write (COW) semantics. |
148
148
| | | This means it's generally slower but can be copied around almost for free. |
@@ -180,8 +180,10 @@ scripting API.
180
180
| | | no heap allocations. |
181
181
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
182
182
| |span | | ``std::span `` | Represents read-only access to a contiguous array without needing to copy any data. |
183
- | | | See `pull request description <https://github.com/godotengine/godot/pull/100293 >`__ |
184
- | | | for details. |
183
+ | | | Note that ``Span `` is designed to be a high performance API: It does not perform |
184
+ | | | parameter correctness checks in the same way you might be used to with other Godot |
185
+ | | | containers. Use with care. |
186
+ | | | `Span ` can be constructed from most array-like containers (e.g. ``vector.span() ``). |
185
187
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
186
188
| |rb_set | | ``std::set `` | Uses a `red-black tree <https://en.wikipedia.org/wiki/Red-black_tree >`__ |
187
189
| | | for faster access. |
@@ -195,16 +197,18 @@ scripting API.
195
197
| | | Use this map type when either of these affordances are needed. Use ``AHashMap `` |
196
198
| | | otherwise. |
197
199
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
198
- | |rb_map | | ``std::map `` | Uses a `red-black tree <https://en.wikipedia.org/wiki/Red-black-tree >`__ |
199
- | | | for faster access. |
200
+ | |rb_map | | ``std::map `` | Map type that uses a |
201
+ | | | `red-black tree <https://en.wikipedia.org/wiki/Red-black-tree >`__ to find keys. |
202
+ | | | The performance benefits of ``RBMap`` aren't established, so prefer using other types.|
200
203
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
201
204
| |dictionary | 📜 | ``std::unordered_map `` | Keys and values can be of any Variant type. No static typing is imposed. |
202
205
| | | Uses shared reference counting, similar to ``std::shared_ptr ``. |
203
206
| | | Preserves insertion order. Uses ``HashMap<Variant> `` internally. |
204
207
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
205
208
| |typed_dictionary | 📜 | ``std::unordered_map `` | Subclass of ``Dictionary `` but with static typing for its keys and values. |
206
209
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
207
- | |pair | | ``std::pair `` | Stores a single key-value pair. |
210
+ | |pair | | ``std::pair `` | Stores a single pair. See also ``KeyValue `` in the same file, which uses read-only |
211
+ | | | keys. |
208
212
+-----------------------+--------------------------+---------------------------------------------------------------------------------------+
209
213
210
214
.. |string | replace :: `String <https://github.com/godotengine/godot/blob/master/core/string/ustring.h >`__
@@ -214,8 +218,8 @@ scripting API.
214
218
.. |string_name | replace :: `StringName <https://github.com/godotengine/godot/blob/master/core/string/string_name.h >`__
215
219
.. |local_vector | replace :: `LocalVector <https://github.com/godotengine/godot/blob/master/core/templates/local_vector.h >`__
216
220
.. |array | replace :: `Array <https://github.com/godotengine/godot/blob/master/core/variant/array.h >`__
217
- .. |typed_array | replace :: `TypedArray <https://github.com/godotengine/godot/blob/master/core/variant/array .h >`__
218
- .. |packed_array | replace :: `Packed*Array <https://github.com/godotengine/godot/blob/master/core/variant/array .h >`__
221
+ .. |typed_array | replace :: `TypedArray <https://github.com/godotengine/godot/blob/master/core/variant/typed_array .h >`__
222
+ .. |packed_array | replace :: `Packed*Array <https://github.com/godotengine/godot/blob/master/core/variant/variant .h >`__
219
223
.. |list | replace :: `List <https://github.com/godotengine/godot/blob/master/core/templates/list.h >`__
220
224
.. |fixed_vector | replace :: `FixedVector <https://github.com/godotengine/godot/blob/master/core/templates/fixed_vector.h >`__
221
225
.. |span | replace :: `Span <https://github.com/godotengine/godot/blob/master/core/templates/span.h >`__
@@ -224,7 +228,7 @@ scripting API.
224
228
.. |a_hash_map | replace :: `AHashMap <https://github.com/godotengine/godot/blob/master/core/templates/a_hash_map.h >`__
225
229
.. |rb_map | replace :: `RBMap <https://github.com/godotengine/godot/blob/master/core/templates/rb_map.h >`__
226
230
.. |dictionary | replace :: `Dictionary <https://github.com/godotengine/godot/blob/master/core/variant/dictionary.h >`__
227
- .. |typed_dictionary | replace :: `TypedDictionary <https://github.com/godotengine/godot/blob/master/core/variant/dictionary .h >`__
231
+ .. |typed_dictionary | replace :: `TypedDictionary <https://github.com/godotengine/godot/blob/master/core/variant/typed_dictionary .h >`__
228
232
.. |pair | replace :: `Pair <https://github.com/godotengine/godot/blob/master/core/templates/pair.h >`__
229
233
230
234
Math types
0 commit comments