Commit 32a332f5 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: add HashTableOps::values() service function

- extract a list of the HashTable values, optionally sorted.
parent 9160dad6
......@@ -140,6 +140,29 @@ struct plusEqOp
//- List of values from HashTable, optionally sorted.
template<class T, class Key, class Hash>
List<T> values(const HashTable<T, Key, Hash>& tbl, const bool doSort=false)
List<T> output(tbl.size());
label i=0;
forAllConstIters(tbl, iter)
output[i] = iter.object();
if (doSort)
return output;
} // End namespace HashTableOps
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment