Skip to content

Make unexpected types in quote variant a compile-time error #2225

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

Merged
merged 1 commit into from
May 16, 2025

Conversation

eltoder
Copy link
Contributor

@eltoder eltoder commented May 15, 2025

Simplify usage of std::visit using a helper visitor type as shown in https://en.cppreference.com/w/cpp/utility/variant/visit2

This also catches unknown types at compile-time instead of run-time even on older compilers.

@eltoder eltoder marked this pull request as draft May 15, 2025 03:06
Simplify usage of std::visit using a helper visitor type as shown in
https://en.cppreference.com/w/cpp/utility/variant/visit2

This also catches unknown types at compile-time instead of run-time even
on older compilers.
@eltoder eltoder force-pushed the feature/from-var-static-assert branch from 919f38e to b0ab8e3 Compare May 15, 2025 19:43
@eltoder eltoder changed the title Use static_assert in handleFromVariant Make unexpected types in quote variant a compile-time error May 15, 2025
@eltoder eltoder marked this pull request as ready for review May 15, 2025 20:20
@coveralls
Copy link

Coverage Status

coverage: 73.327% (+0.001%) from 73.326%
when pulling b0ab8e3 on eltoder:feature/from-var-static-assert
into 46a3903 on lballabio:master.

@lballabio
Copy link
Owner

Thanks! I thought I had seen something like this but couldn't find it :)

@lballabio lballabio added this to the Release 1.39 milestone May 16, 2025
@lballabio lballabio merged commit 10171b8 into lballabio:master May 16, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants