Reuse Regular Automata functionality
This commit is contained in:
parent
b3e5bf0941
commit
56d63f2f18
17 changed files with 1033 additions and 1058 deletions
|
|
@ -165,7 +165,12 @@ namespace tp {
|
|||
}
|
||||
};
|
||||
|
||||
template <typename tType, class tAllocator = DefaultAllocator, ualni(tResizePolicy)(ualni) = BufferResizeScaling<2>, ualni(tResizePolicyDown)(ualni) = BufferResizeScalingDown<2>, ualni tMinSize = 4>
|
||||
template <
|
||||
typename tType,
|
||||
class tAllocator = DefaultAllocator,
|
||||
ualni(tResizePolicy)(ualni) = BufferResizeScaling<2>,
|
||||
ualni(tResizePolicyDown)(ualni) = BufferResizeScalingDown<2>,
|
||||
ualni tMinSize = 4>
|
||||
class Buffer {
|
||||
typedef SelectValueOrReference<tType> Arg;
|
||||
|
||||
|
|
@ -305,7 +310,7 @@ namespace tp {
|
|||
mBuff = (tType*) mAllocator.allocate(sizeof(tType) * mSize);
|
||||
mLoad = 0;
|
||||
for (const auto& val : input) {
|
||||
mBuff[mLoad] = val;
|
||||
new (&mBuff[mLoad]) tType(val);
|
||||
mLoad++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue