Skip to content
Snippets Groups Projects
Commit 88e63cd8 authored by Markus Blatt's avatar Markus Blatt
Browse files

[bugfix] Fixes comparison operators.


The last patch missed a change in the comparison operators. Allocators
compare as equal if memory allocated with one can be deallocate with
the other. With this allocators compare equal only if they are share
the same address.

Cherry-pick from branch eature/FS1429-shared-lib-fixes where it ended up
by accident.
(cherry picked from commit c00b2acc)

Signed-off-by: default avatarMarkus Blatt <markus@dr-blatt.de>
parent 0214d48d
No related branches found
No related tags found
No related merge requests found
......@@ -406,30 +406,16 @@ namespace Dune
}
template<typename T, std::size_t t1, std::size_t t2>
bool operator==(const PoolAllocator<T,t1>&, const PoolAllocator<T,t2>&)
bool operator==(const PoolAllocator<T,t1>& p1, const PoolAllocator<T,t2>& p2)
{
return Pool<T,t1>::chunkSize == Pool<T,t2>::chunkSize;
return &p1==&p2;
}
template<typename T, std::size_t t1, std::size_t t2>
bool operator!=(const PoolAllocator<T,t1>&, const PoolAllocator<T,t2>&)
bool operator!=(const PoolAllocator<T,t1>& p1, const PoolAllocator<T,t2>& p2)
{
return Pool<T,t1>::chunkSize != Pool<T,t2>::chunkSize;
}
template<typename T, std::size_t t1, std::size_t t2>
bool operator==(const PoolAllocator<T,t1>&, const PoolAllocator<void,t2>&)
{
return false;
}
template<typename T, std::size_t t1, std::size_t t2>
bool operator!=(const PoolAllocator<T,t1>&, const PoolAllocator<void,t2>&)
{
return true;
return &p1 != &p2;
}
template<typename T, std::size_t t1, std::size_t t2>
......@@ -444,16 +430,17 @@ namespace Dune
{
return true;
}
template<std::size_t t1, std::size_t t2>
bool operator==(const PoolAllocator<void,t1>&, const PoolAllocator<void,t2>&)
bool operator==(const PoolAllocator<void,t1>& p1, const PoolAllocator<void,t2>& p2)
{
return true;
return &p1==&p2;
}
template<std::size_t t1, std::size_t t2>
bool operator!=(const PoolAllocator<void,t1>&, const PoolAllocator<void,t2>&)
bool operator!=(const PoolAllocator<void,t1>& p1, const PoolAllocator<void,t2>& p2)
{
return false;
return &p1!=&p2;
}
template<class T, std::size_t S>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment