Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::variant is not implemented for treebuilder v2 #298

Open
JakeHillion opened this issue Aug 18, 2023 · 1 comment
Open

std::variant is not implemented for treebuilder v2 #298

JakeHillion opened this issue Aug 18, 2023 · 1 comment
Assignees
Labels
library An issue specific to the OI Library (OIL). types Handling of a specific type

Comments

@JakeHillion
Copy link
Contributor

This is probably the most difficult type to support, given its template varargs. I would leave this one for me unless you're feeling particularly adventurous.

Examples:

  • OilIntegration.std_variant_char_int64_1
  • OilIntegration.std_variant_char_int64_2
  • OilIntegration.std_variant_vector_int_1
  • OilIntegration.std_variant_vector_int_2
  • OilIntegration.std_variant_optional
  • OilIntegration.std_variant_empty
  • OilIntegration.std_variant_256_params_256
  • OilIntegration.std_variant_256_params_empty
@JakeHillion JakeHillion added types Handling of a specific type codegen Code Generation Framework library An issue specific to the OI Library (OIL). labels Aug 18, 2023
@JakeHillion JakeHillion self-assigned this Aug 18, 2023
@JakeHillion JakeHillion removed the codegen Code Generation Framework label Aug 18, 2023
@JakeHillion
Copy link
Contributor Author

This is a bit more problematic than expected. TBv2 generates the handler for std::variant as struct TypeHandler<Ctx, std::variant<T0, T1>> based on the number of arguments the first variant it encounters has. This is in contrast to the usual CodeGen-v2 where the container specification details that the template is template <typename... Types>.

We need some extra container configuration parameter to make this work. Annoyingly we need CodeGen to generate:

template <typename Ctx, typename... Types>
struct TypeHandler<Ctx, std::variant<Types...>> {};

Where the Types pack appears differently in each case. There is some planning required here, though of the current containers this will only apply to std::variant and parameters with parameter packs likely aren't very common.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
library An issue specific to the OI Library (OIL). types Handling of a specific type
Projects
None yet
Development

No branches or pull requests

1 participant