Skip to content

Commit

Permalink
docs(core): add expected output to sample
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Sep 26, 2023
1 parent 8f5aca0 commit 3ff90d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/samples/reflection/traits/array/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,18 @@ void printArray(const T& array)

int main()
{
std::vector<int> vec = {1, 1, 2, 3, 5, 8, 13};
std::vector<int32_t> vec = {1, 1, 2, 3, 5, 8, 13};
printArray(vec);

/// [Expected output]
// Array with 7 elements of type int32_t
// Element 0: 1
// Element 1: 1
// Element 2: 2
// Element 3: 3
// Element 4: 5
// Element 5: 8
// Element 6: 13
/// [Expected output]
}
/// [Usage]
4 changes: 4 additions & 0 deletions core/samples/reflection/traits/array/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ Using this function is now as simple as:

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:

@snippet reflection/traits/array/main.cpp Expected output

0 comments on commit 3ff90d1

Please sign in to comment.