Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 381
    • Issues 381
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #1845

Closed
Open
Created Sep 21, 2020 by Mark Olesen@markMaintainer

add dispatch tags

for some places such as refPtr it would be useful to support construct read/write as well as construct read-only. However, there is no convenient or reliable means to do so. Eg,

volScalarField fld(...);

refPtr someRef(fld);

Should this be a const reference or a non-const reference? Currently we only have construct from const-ref since relying on the constness of the supplied argument is fragile at best, or simply wrong.

Propose adding a tagged dispatch constructor. Eg,

//- Construct for a non-const reference to an object.
inline refPtr(T& obj, stdFoam::output_t) noexcept;

I think that input_t and output_t might be reasonable enough names (vs read/write) that might be possibly to use elsewhere as well. Would declare in stdFoam.H to make globally available.

Assignee
Assign to
Time tracking