mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
37 lines
500 B
C++
37 lines
500 B
C++
/*
|
|
* Vector.h
|
|
*
|
|
* Created on: 7 Dec 2015
|
|
* Author: hieu
|
|
*/
|
|
|
|
#pragma once
|
|
#include <cassert>
|
|
#include "MemPoolAllocator.h"
|
|
|
|
namespace Moses2
|
|
{
|
|
|
|
template<typename T>
|
|
class Vector: public std::vector<T, MemPoolAllocator<T> >
|
|
{
|
|
typedef std::vector<T, MemPoolAllocator<T> > Parent;
|
|
|
|
public:
|
|
Vector(MemPool &pool, size_t size = 0, const T &val = T()) :
|
|
Parent(size, val, MemPoolAllocator<T>(pool))
|
|
{
|
|
}
|
|
|
|
Vector(const Vector ©) :
|
|
Parent(copy)
|
|
{
|
|
}
|
|
|
|
protected:
|
|
};
|
|
|
|
|
|
}
|
|
|