|
@ -119,5 +119,29 @@ namespace gp{ |
|
|
return buffer{(T*)nullptr,(size_t)0}; |
|
|
return buffer{(T*)nullptr,(size_t)0}; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
buffer trim_start(size_t rm_sz) |
|
|
|
|
|
{ |
|
|
|
|
|
if(rm_sz<=size()) |
|
|
|
|
|
{ |
|
|
|
|
|
return buffer{begin().data + rm_sz, end().data}; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
return buffer{(T*)nullptr,(size_t)0}; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
buffer trim_end(size_t rm_sz) |
|
|
|
|
|
{ |
|
|
|
|
|
if(rm_sz<=size()) |
|
|
|
|
|
{ |
|
|
|
|
|
return buffer{begin().data, end().data - rm_sz}; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
return buffer{(T*)nullptr,(size_t)0}; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |