1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Hadrons: no errors when trying to recreate a cache

This commit is contained in:
Antonin Portelli 2017-12-19 20:28:32 +00:00
parent e2fe97277b
commit 65d4f17976

View File

@ -228,7 +228,11 @@ void Environment::createDerivedObject(const std::string name,
MemoryProfiler::stats = nullptr;
}
}
else
// object already exists, no error if it is a cache, error otherwise
else if ((object_[address].storage != Storage::cache) or
(object_[address].storage != storage) or
(object_[address].name != name) or
(object_[address].type != &typeid(T)))
{
HADRON_ERROR(Definition, "object '" + name + "' already allocated");
}