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

Admin message

A Gitlab update will be applied on June 5th , between 6PM - 7PM EDT (UTC-04:00). This site may have intermittent delays during that time.

  • VTKVTK
  • VTK-mVTK-m
  • Merge requests
  • !3018

Implement VecTraits class for all types

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Kenneth Moreland requested to merge kmorel/vtk-m:vectraits-for-all into master Mar 16, 2023
  • Overview 13
  • Commits 1
  • Pipelines 7
  • Changes 21

The VecTraits class allows templated functions, methods, and classes to treat type arguments uniformly as Vec types or to otherwise differentiate between scalar and vector types. This only works for types that VecTraits is defined for.

The VecTraits templated class now has a default implementation that will be used for any type that does not have a VecTraits specialization. This removes many surprise compiler errors when using a template that, unknown to you, has VecTraits in its implementation.

One potential issue is that if VecTraits gets defined for a new type, the behavior of VecTraits could change for that type in backward-incompatible ways. If VecTraits is used in a purely generic way, this should not be an issue. However, if assumptions were made about the components and length, this could cause problems.

Fixes #589 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: vectraits-for-all