@@ -45,6 +45,8 @@ variables and ``nullptr`` is encouraged when possible. Still, try to keep your
4545use of modern C++ features conservative. Their use needs to serve a real
4646purpose, such as improving code readability or performance.
4747
48+ .. _doc_cpp_godot_types :
49+
4850Standard Template Library
4951~~~~~~~~~~~~~~~~~~~~~~~~~
5052
@@ -75,6 +77,7 @@ scripting API.
7577+------------------------+--------------------------+---------------------------------------------------------------------------------------+
7678| ``Array `` 📜 | ``std::vector `` | Values can be of any Variant type. No static typing is imposed. |
7779| | | Uses shared reference counting, similar to ``std::shared_ptr ``. |
80+ | | | Uses Vector<Variant> internally. |
7881+------------------------+--------------------------+---------------------------------------------------------------------------------------+
7982| ``TypedArray `` 📜 | ``std::vector `` | Subclass of ``Array `` but with static typing for its elements. |
8083| | | Not to be confused with ``Packed*Array ``, which is internally a ``Vector ``. |
@@ -99,7 +102,7 @@ scripting API.
99102| | | This means it's generally slower but can be copied around almost for free. |
100103| | | The performance benefits of ``VSet `` aren't established, so prefer using other types. |
101104+------------------------+--------------------------+---------------------------------------------------------------------------------------+
102- | ``HashMap `` | ``std::unordered_map `` | **Use this as the "default" map type. ** Does not preserve insertion order. |
105+ | ``HashMap `` | ``std::unordered_map `` | **Use this as the "default" map type. ** Preserves insertion order. |
103106+------------------------+--------------------------+---------------------------------------------------------------------------------------+
104107| ``AHashMap `` | ``std::unordered_map `` | Array-based implementation of a hash map. Does not preserve insertion order. |
105108+------------------------+--------------------------+---------------------------------------------------------------------------------------+
@@ -114,6 +117,7 @@ scripting API.
114117+------------------------+--------------------------+---------------------------------------------------------------------------------------+
115118| ``Dictionary `` 📜 | ``std::unordered_map `` | Keys and values can be of any Variant type. No static typing is imposed. |
116119| | | Uses shared reference counting, similar to ``std::shared_ptr ``. |
120+ | | | Preserves insertion order. Uses ``HashMap<Variant> `` internally. |
117121+------------------------+--------------------------+---------------------------------------------------------------------------------------+
118122| ``TypedDictionary `` 📜 | ``std::unordered_map `` | Subclass of ``Dictionary `` but with static typing for its keys and values. |
119123+------------------------+--------------------------+---------------------------------------------------------------------------------------+
0 commit comments