@@ -45,6 +45,8 @@ variables and ``nullptr`` is encouraged when possible. Still, try to keep your
45
45
use of modern C++ features conservative. Their use needs to serve a real
46
46
purpose, such as improving code readability or performance.
47
47
48
+ .. _doc_cpp_godot_types :
49
+
48
50
Standard Template Library
49
51
~~~~~~~~~~~~~~~~~~~~~~~~~
50
52
@@ -75,6 +77,7 @@ scripting API.
75
77
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
76
78
| ``Array `` 📜 | ``std::vector `` | Values can be of any Variant type. No static typing is imposed. |
77
79
| | | Uses shared reference counting, similar to ``std::shared_ptr ``. |
80
+ | | | Uses Vector<Variant> internally. |
78
81
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
79
82
| ``TypedArray `` 📜 | ``std::vector `` | Subclass of ``Array `` but with static typing for its elements. |
80
83
| | | Not to be confused with ``Packed*Array ``, which is internally a ``Vector ``. |
@@ -103,7 +106,7 @@ scripting API.
103
106
| | | This means it's generally slower but can be copied around almost for free. |
104
107
| | | The performance benefits of ``VSet `` aren't established, so prefer using other types. |
105
108
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
106
- | ``HashMap `` | ``std::unordered_map `` | **Use this as the "default" map type. ** Does not preserve insertion order. |
109
+ | ``HashMap `` | ``std::unordered_map `` | **Use this as the "default" map type. ** Preserves insertion order. |
107
110
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
108
111
| ``AHashMap `` | ``std::unordered_map `` | Array-based implementation of a hash map. Does not preserve insertion order. |
109
112
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
@@ -118,6 +121,7 @@ scripting API.
118
121
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
119
122
| ``Dictionary `` 📜 | ``std::unordered_map `` | Keys and values can be of any Variant type. No static typing is imposed. |
120
123
| | | Uses shared reference counting, similar to ``std::shared_ptr ``. |
124
+ | | | Preserves insertion order. Uses ``HashMap<Variant> `` internally. |
121
125
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
122
126
| ``TypedDictionary `` 📜 | ``std::unordered_map `` | Subclass of ``Dictionary `` but with static typing for its keys and values. |
123
127
+------------------------+--------------------------+---------------------------------------------------------------------------------------+
0 commit comments