Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • E elsa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 51
    • Issues 51
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • IPIP
  • elsa
  • Issues
  • #31
Closed
Open
Issue created Dec 04, 2019 by Tobias Lasser@lasserOwner

Copy constructors in non-leaf classes

As discussed with Nikola yesterday: The classes inheriting from Cloneable need to explicitly make their copy constructors protected or = delete, as otherwise the compiler will implicitly generate a public copy constructor. This should be added everywhere necessary and commented appropriately (even in current leaf classes, in case someone derives from them at a later point).

The same is true with copy assignment, however that can be taken care of by = deleteing it in Cloneable. That should be ok, since we will (usually) never want to copy assign polymorphic classes anyway.

There is a special case for LinearOperator: it currently exposes public copy construction and assignment, which is required for the composite operator functionality to work, but is hugely problematic otherwise (it can result in slicing when, e.g. assigning a Scaling operator to a LinearOperator). I currently have no good idea how to solve this (and keep the value semantics of composite LinearOperators at the same time), excepting trying to restrict their usage somehow through clever protected and friend manipulations.

Edited Dec 04, 2019 by Tobias Lasser
Assignee
Assign to
Time tracking

LRZ Homepage | Datenschutz | Dokumentation und Betriebsbedingungen | Impressum