mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: ensure that emptyLabelList is known from List.H
- treat as a List constant without requiring inclusion of ListOps.H - replace use of emptyList<label>() with emptyLabelList directly. The emptyList<T>() casting is disallowed with many modern compilers and now marked as deprecated (expect early removal). - relocate labelList typedef to List.H for more general access. Similar reasoning to having labelUList defined in UList.H
This commit is contained in:
@ -2398,7 +2398,7 @@ const Foam::labelList& Foam::dynamicIndexedOctree<Type>::findIndices
|
|||||||
return *(contents_[getContent(contentIndex)]);
|
return *(contents_[getContent(contentIndex)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return emptyList<label>();
|
return Foam::emptyLabelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2660,7 +2660,7 @@ const Foam::labelList& Foam::indexedOctree<Type>::findIndices
|
|||||||
{
|
{
|
||||||
if (nodes_.empty())
|
if (nodes_.empty())
|
||||||
{
|
{
|
||||||
return emptyList<label>();
|
return Foam::emptyLabelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
labelBits index = findNode(0, sample);
|
labelBits index = findNode(0, sample);
|
||||||
@ -2675,7 +2675,7 @@ const Foam::labelList& Foam::indexedOctree<Type>::findIndices
|
|||||||
return contents_[getContent(contentIndex)];
|
return contents_[getContent(contentIndex)];
|
||||||
}
|
}
|
||||||
|
|
||||||
return emptyList<label>();
|
return Foam::emptyLabelList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -69,8 +69,12 @@ template<class T> class BiIndirectList;
|
|||||||
|
|
||||||
template<class T> Istream& operator>>(Istream& is, List<T>& list);
|
template<class T> Istream& operator>>(Istream& is, List<T>& list);
|
||||||
|
|
||||||
// Commonly required list types
|
// Common list types
|
||||||
typedef List<char> charList;
|
typedef List<char> charList;
|
||||||
|
typedef List<label> labelList;
|
||||||
|
|
||||||
|
//- A zero-sized list of labels
|
||||||
|
extern const labelList emptyLabelList;
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Global Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
const Foam::labelList Foam::emptyLabelList;
|
const Foam::labelList Foam::emptyLabelList;
|
||||||
|
|
||||||
|
|||||||
@ -54,10 +54,10 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
extern const labelList emptyLabelList;
|
//- Return reference to zero-sized list.
|
||||||
|
// Compare to List::null() which returns null pointer cast as list reference.
|
||||||
//- Return reference to zero-sized list. Compare to List::null() which returns
|
//
|
||||||
// null pointer cast as list reference.
|
// \deprecated This cast is disallowed with many modern compilers (JUL-2018)
|
||||||
template<class Type>
|
template<class Type>
|
||||||
static const List<Type>& emptyList()
|
static const List<Type>& emptyList()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,6 +47,13 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// Forward declarations
|
||||||
|
template<class T> class SubList;
|
||||||
|
|
||||||
|
// Common list types
|
||||||
|
typedef SubList<label> labelSubList;
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class SubList Declaration
|
Class SubList Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -67,10 +67,11 @@ template<class T> class UList;
|
|||||||
template<class T> Ostream& operator<<(Ostream&, const UList<T>&);
|
template<class T> Ostream& operator<<(Ostream&, const UList<T>&);
|
||||||
template<class T> Istream& operator>>(Istream&, UList<T>&);
|
template<class T> Istream& operator>>(Istream&, UList<T>&);
|
||||||
|
|
||||||
// Commonly required list types
|
// Common list types
|
||||||
typedef UList<char> charUList;
|
typedef UList<char> charUList;
|
||||||
typedef UList<label> labelUList;
|
typedef UList<label> labelUList;
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class UList Declaration
|
Class UList Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -64,9 +64,10 @@ Description
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
// NB: labelUList is defined in UList itself
|
// labelUList = defined in UList.H
|
||||||
typedef List<label> labelList;
|
// labelList = defined in List.H
|
||||||
typedef SubList<label> labelSubList;
|
// labelSubList = defined in SubList.H
|
||||||
|
|
||||||
typedef List<labelList> labelListList;
|
typedef List<labelList> labelListList;
|
||||||
typedef List<labelListList> labelListListList;
|
typedef List<labelListList> labelListListList;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user