Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK-m VTK-m
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 206
    • Issues 206
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 35
    • Merge requests 35
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTK-mVTK-m
  • Merge requests
  • !2596

Handle `Variant::Get` for types not supported by the `Variant`

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Kenneth Moreland requested to merge kmorel/vtk-m:variant-get-unsupported-type into master Oct 04, 2021
  • Overview 10
  • Commits 1
  • Pipelines 4
  • Changes 2

Previously, if you called Get on a Variant with a type that is not in the list of types supported by the Variant, that would attempt to look up the type at index -1 and could spin the compiler into an endless loop.

Instead, check for the case where you are attempting to get a type from the Variant not listed in its templat arguments. In this case, instead of producing a compiler error, produce a runtime error. Although this increases the possibility that a bad compile path is being generated, it simplifies creating templated code that produces cases we don't care about.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: variant-get-unsupported-type