Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 426
    • Issues 426
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #1775
Closed
Open
Issue created Jul 15, 2020 by Mark OLESEN@markMaintainer

cleanup of autoPtr, tmp classes

Should remove some slight inconsistencies between autoPtr and tmp, and reduce some coding verbosity.

  • For autoPtr, can use assignment from nullptr to effect a reset. Should also be allowed for tmp.
  • Reduce use of autoPtr empty() and valid() methods.

The autoPtr empty() method was introduced (Jan-2009) to reduce these types of constructs:

if (!myPtr.valid()) ...
if (myPtr.empty()) ...

But now there are some places with this type of thing:

if (!myPtr.empty()) ...

Since we now have an explicit bool operator, probably makes sense to use that instead:

if (myPtr) ...
if (!myPtr) ...
Edited Jul 15, 2020 by Mark OLESEN
Assignee
Assign to
Time tracking