BUG: HashTable: remove conversion operator from iterator to const_iterator

This commit is contained in:
mattijs
2011-03-09 18:08:30 +00:00
parent 92ff766c19
commit 4d2cf1472f
3 changed files with 18 additions and 24 deletions

View File

@ -97,18 +97,16 @@ struct HashTableCore
{}
};
static const iteratorEnd endIter;
//- iteratorEnd set to beyond the end of any HashTable
inline static const iteratorEnd& cend()
inline static iteratorEnd cend()
{
return endIter;
return iteratorEnd();
}
//- iteratorEnd set to beyond the end of any HashTable
inline static const iteratorEnd& end()
inline static iteratorEnd end()
{
return endIter;
return iteratorEnd();
}
};
@ -451,9 +449,6 @@ public:
// Member operators
//- Conversion to a const_iterator
inline operator const_iterator() const;
//- Return referenced hash value
inline T& operator*();
inline T& operator()();
@ -503,6 +498,9 @@ public:
//- Construct null (end iterator)
inline const_iterator();
//- Construct from iterator
inline const_iterator(const iterator&);
//- Construct end iterator
inline const_iterator(const iteratorEnd& unused);

View File

@ -37,9 +37,6 @@ const Foam::label Foam::HashTableCore::maxTableSize
)
);
const Foam::HashTableCore::iteratorEnd Foam::HashTableCore::endIter;
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::HashTableCore::canonicalSize(const label size)

View File

@ -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
@ -362,17 +362,6 @@ inline Foam::HashTable<T, Key, Hash>::iterator::iterator
{}
template<class T, class Key, class Hash>
inline Foam::HashTable<T, Key, Hash>::iterator::operator
typename Foam::HashTable<T, Key, Hash>::const_iterator() const
{
return *reinterpret_cast
<
const typename Foam::HashTable<T, Key, Hash>::const_iterator*
>(this);
}
template<class T, class Key, class Hash>
inline T&
Foam::HashTable<T, Key, Hash>::iterator::operator*()
@ -442,6 +431,16 @@ inline Foam::HashTable<T, Key, Hash>::const_iterator::const_iterator()
{}
template<class T, class Key, class Hash>
inline Foam::HashTable<T, Key, Hash>::const_iterator::const_iterator
(
const HashTable<T, Key, Hash>::iterator& iter
)
:
iteratorBase(iter)
{}
template<class T, class Key, class Hash>
inline Foam::HashTable<T, Key, Hash>::const_iterator::const_iterator
(