Skip to content

Commit

Permalink
Added allocator construct and destroy members for older gcc versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrprice authored and mpflanzer committed Jul 7, 2015
1 parent 0405179 commit cd2867c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,18 @@ namespace oclgrind

void deallocate(pointer p, size_type n){}

template<class U, class... Args>
void construct(U *p, Args&&... args)
{
new (p) U(std::forward<Args>(args)...);
}

template<class U>
void destroy(U *p)
{
p->~U();
}

bool operator==(const PoolAllocator& p) const
{
return this->pool == p.pool;
Expand Down

0 comments on commit cd2867c

Please sign in to comment.