std::variant is the last archetypal container missing in TreeBuilder-v2. The
code for it isn't hugely complicated and relies on pack expansion.
This change introduces a new field to the container specification:
scoped_extra. This field allows you to write extra code that will be included
within the TypeHandler in CodeGen. This means it will not have collisions with
other containers, unlike the existing extra field. It's used here to write
the recursive getSizeType function for std::variant.
Tech debt is introduced here by comparing the container name to std::variant
in CodeGen to conditionally generate some code. We've worked hard to remove
references to containers in code and move them to .toml files. On balance,
this is worth having to include the example of std::variant. It should be
moved into a container spec field at some point, the design of which is still
to be determined.
tbv2: update std::variant
std::variant
is the last archetypal container missing in TreeBuilder-v2. The code for it isn't hugely complicated and relies on pack expansion.This change introduces a new field to the container specification:
scoped_extra
. This field allows you to write extra code that will be included within the TypeHandler in CodeGen. This means it will not have collisions with other containers, unlike the existingextra
field. It's used here to write the recursivegetSizeType
function forstd::variant
.Tech debt is introduced here by comparing the container name to
std::variant
in CodeGen to conditionally generate some code. We've worked hard to remove references to containers in code and move them to.toml
files. On balance, this is worth having to include the example ofstd::variant
. It should be moved into a container spec field at some point, the design of which is still to be determined.Test plan:
std::variant
tests.