Skip to content

Commit d9dcaa5

Browse files
committed
Reimplement unique_ptr-based span API
1 parent 2afc3b4 commit d9dcaa5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/RecordComponent.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ namespace
195195
template <typename T>
196196
auto createSpanBufferFallback(size_t size) -> std::shared_ptr<T>
197197
{
198-
return std::shared_ptr<T>{new T[size], [](auto *ptr) { delete[] ptr; }};
198+
return UniquePtrWithLambda<T>{
199+
new T[size], [](auto *ptr) { delete[] ptr; }};
199200
}
200201
#else
201202
template <typename T>
202203
auto createSpanBufferFallback(size_t size) -> std::shared_ptr<T[]>
203204
{
204-
return std::shared_ptr<T[]>{new T[size]};
205+
return std::unique_ptr<T[]>{new T[size]};
205206
}
206207
#endif
207208
} // namespace

0 commit comments

Comments
 (0)