Ref T476 Static asserts to ensure array and non-array datarefs are used correctly.

This commit is contained in:
Mat Sutcliffe
2019-05-12 21:27:51 +01:00
parent 693c94c87a
commit f39b277413
3 changed files with 10277 additions and 82 deletions

View File

@@ -136,8 +136,15 @@ ${in}${indent}using type = $type;
EOF
print <<"EOF" if defined $size;
${in}${indent}//! Is an array dataref
${in}${indent}static constexpr bool is_array = true;
${in}${indent}//! Size of array dataref
${in}${indent}static constexpr size_t size = $size;
EOF
print <<"EOF" unless defined $size;
${in}${indent}//! Not an array dataref
${in}${indent}static constexpr bool is_array = false;
EOF
print <<"EOF";