diff --git a/pr-preview/pr-546/examples-core-reflection-traits-array.html b/pr-preview/pr-546/examples-core-reflection-traits-array.html index ec1ac4f41..38aaf04d4 100644 --- a/pr-preview/pr-546/examples-core-reflection-traits-array.html +++ b/pr-preview/pr-546/examples-core-reflection-traits-array.html @@ -68,7 +68,7 @@

{ CUBOS_INFO("Element {}: {}", i, *static_cast<const int32_t*>(arrayTrait.get(instance, i))); } -}

In this example, we're only supporting arrays of ints, but we could for example implement a printing function which supports all primitive types.

To make calling our function easier, we can add a convenience typed wrapper:

template <typename T>
+}

In this example, we're only supporting arrays of int32_ts, but we could for example implement a printing function which supports all primitive types.

To make calling our function easier, we can add a convenience typed wrapper:

template <typename T>
 void printArray(const T& array)
 {
     using cubos::core::reflection::reflect;
@@ -90,7 +90,7 @@ 

// Element 4: 5 // Element 5: 8 // Element 6: 13 -}

Its important to note that both the includes above are necessary, as we're reflecting the type std::vector<int>, which also means reflecting int.

Executing the sample should output:

    // Array with 7 elements of type int32_t
+}

Its important to note that both the includes above are necessary, as we're reflecting the type std::vector<int32_t>, which also means reflecting int32_t.

Executing the sample should output:

    // Array with 7 elements of type int32_t
     // Element 0: 1
     // Element 1: 1
     // Element 2: 2