STYLE: use noexcept creation of InfoProxy and dereference as '*iproxy'

- this removes the 'magic' use of the exposed t_ member in favour
  of a generic dereference
This commit is contained in:
Mark Olesen
2023-05-17 09:34:09 +02:00
parent a0005c3a54
commit a5d9ad3a5c
52 changed files with 287 additions and 273 deletions

View File

@ -33,10 +33,10 @@ template<class Gt, class Cb>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const InfoProxy<CGAL::indexedCell<Gt, Cb>>& p
const InfoProxy<CGAL::indexedCell<Gt, Cb>>& iproxy
)
{
const CGAL::indexedCell<Gt, Cb>& iv = p.t_;
const auto& iv = *iproxy;
os << "Cell: ";

View File

@ -249,9 +249,9 @@ public:
// Info
//- Return info proxy.
// Used to print indexedCell information to a stream
Foam::InfoProxy<indexedCell<Gt, Cb>> info() const
//- Return info proxy,
//- used to print information to a stream
Foam::InfoProxy<indexedCell<Gt, Cb>> info() const noexcept
{
return *this;
}
@ -261,7 +261,6 @@ public:
Foam::Ostream&,
const Foam::InfoProxy<indexedCell<Gt, Cb>>&
);
};

View File

@ -156,10 +156,10 @@ template<class Gt, class Vb>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const InfoProxy<CGAL::indexedVertex<Gt, Vb>>& p
const InfoProxy<CGAL::indexedVertex<Gt, Vb>>& iproxy
)
{
const CGAL::indexedVertex<Gt, Vb>& iv = p.t_;
const auto& iv = *iproxy;
const Foam::point pt
(

View File

@ -313,8 +313,9 @@ public:
// IOstream Operators
//- Info proxy, to print information to a stream
Foam::InfoProxy<indexedVertex<Gt, Vb>> info() const
//- Return info proxy,
//- used to print information to a stream
Foam::InfoProxy<indexedVertex<Gt, Vb>> info() const noexcept
{
return *this;
}

View File

@ -654,7 +654,7 @@ Foam::Ostream& Foam::operator<<
const InfoProxy<PDRobstacle>& iproxy
)
{
const PDRobstacle& obs = iproxy.t_;
const auto& obs = *iproxy;
switch (obs.typeId)
{

View File

@ -37,8 +37,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef PDRobstacle_H
#define PDRobstacle_H
#ifndef Foam_PDRobstacle_H
#define Foam_PDRobstacle_H
#include "InfoProxy.H"
#include "labelPair.H"
@ -290,8 +290,9 @@ public:
// IOstream Operators
//- Return info proxy.
InfoProxy<PDRobstacle> info() const
//- Return info proxy,
//- used to print information to a stream
InfoProxy<PDRobstacle> info() const noexcept
{
return *this;
}