1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-14 01:35:36 +00: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; 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"); HADRON_ERROR(Definition, "object '" + name + "' already allocated");
} }