mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: HashTable: make end() iterator a reference to a static.
Weird one. Reported crash with gcc452 with end() iterator returning a copy. The end() iterator returned was not initialised. No idea why & could not repeat.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -97,16 +97,18 @@ struct HashTableCore
|
||||
{}
|
||||
};
|
||||
|
||||
static const iteratorEnd endIter;
|
||||
|
||||
//- iteratorEnd set to beyond the end of any HashTable
|
||||
inline static iteratorEnd cend()
|
||||
inline static const iteratorEnd& cend()
|
||||
{
|
||||
return iteratorEnd();
|
||||
return endIter;
|
||||
}
|
||||
|
||||
//- iteratorEnd set to beyond the end of any HashTable
|
||||
inline static iteratorEnd end()
|
||||
inline static const iteratorEnd& end()
|
||||
{
|
||||
return iteratorEnd();
|
||||
return endIter;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,6 +37,9 @@ const Foam::label Foam::HashTableCore::maxTableSize
|
||||
)
|
||||
);
|
||||
|
||||
const Foam::HashTableCore::iteratorEnd Foam::HashTableCore::endIter;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::HashTableCore::canonicalSize(const label size)
|
||||
|
||||
Reference in New Issue
Block a user