Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • Gaudi Gaudi
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 115
    • Issues 115
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GaudiGaudi
  • GaudiGaudi
  • Merge requests
  • !1249

Make Gaudi::Functional constructors more paranoid about # of inputs/outputs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Gerhard Raven requested to merge tweak-functional-constructors into master Aug 30, 2021
  • Overview 8
  • Commits 1
  • Pipelines 4
  • Changes 3

Currenly, the constructors of the Gaudi::Functional baseclasses use std::array<KeyValue,N> as arguments where N is the number of inputs or outputs specified. However, this implies that one can specify a list of less than N KeyValues, as std::array will happily default-initialize any missing items. This will then result in an error in genConf, as this implies a property with a default-initialized string (i.e. an empty string) as key.

This is fixed by replacing the use std::array<KeyValue,N> with a tuple with N KeyValues, eg. for N=2 an std::tuple<KeyValue,KeyValue>.

Warning/Caveat: some (rare) user code may have hardwired the assumption of an std::array, and thus will have to be migrated. To easy this migration, the version which uses std::tuple also defines the preprocessor symbol GAUDI_FUNCTIONAL_CONSTRUCTOR_USES_TUPLE, which can be used to adapt the client code in a backwards compatible manner.

Edited Aug 31, 2021 by Gerhard Raven
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: tweak-functional-constructors