Reuse Regular Automata functionality

This commit is contained in:
IlyaShurupov 2024-02-03 17:10:29 +03:00 committed by Ilusha
parent 656da1fd76
commit 7112002e30
17 changed files with 1033 additions and 1058 deletions

View file

@ -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++;
}