diff --git a/applications/test/PackedList/PackedListTest.C b/applications/test/PackedList/PackedListTest.C index 1e0ca6f385dbf2476a485639052cc73ad68697ee..e5670b3cbe91c9c033d01b0f8984fed4e3256e34 100644 --- a/applications/test/PackedList/PackedListTest.C +++ b/applications/test/PackedList/PackedListTest.C @@ -82,9 +82,13 @@ int main(int argc, char *argv[]) argList::noParallel(); argList::validArgs.insert("file .. fileN"); - argList::addBoolOption("mask"); - argList::addBoolOption("count"); - argList::addBoolOption("info"); + argList::addBoolOption("mask", "report information about the bit masks"); + argList::addBoolOption("count", "test the count() method"); + argList::addBoolOption + ( + "info", + "print an ascii representation of the storage" + ); argList args(argc, argv, false, true); diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H index df7786f61b8cb9f030182269cc5056411efe504d..92d6c02d72dc71aa6e7bea80fcefe156cf441f73 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H @@ -839,7 +839,24 @@ Foam::PackedList<nBits>::operator[](const label i) } -// specialization for nBits=1 isn't worth the bother +namespace Foam +{ + // specialization for nBits=1 + template<> + inline void Foam::PackedList<1>::operator=(const unsigned int val) + { + if (val) + { + StorageList::operator=(~0u); + } + else + { + StorageList::operator=(0u); + } + } +} + + template<unsigned nBits> inline void Foam::PackedList<nBits>::operator=(const unsigned int val) {