128 typedef typename std::remove_const<T>::type
VT;
140 if (gc_ && gc_->
count.fetch_sub(1, std::memory_order_release) == 1) {
141 std::atomic_thread_fence(std::memory_order_acquire);
143 gc_->
free(
reinterpret_cast<void*
>(
const_cast<VT*
>(data_)));
150 if (gc_) gc_->
count.fetch_add(1, std::memory_order_relaxed);
205 template <
typename TS>
208 std::copy(src.
begin(), src.
end(),
const_cast<VT*
>(data_));
220 data_ =
const_cast<T*
>(M.data_);
234 data_ =
const_cast<T*
>(M.data_);
270 template <
typename TS>
280 template <
typename TS>
291 template <
typename TS>
301 std::copy(init.begin(), init.end(),
const_cast<VT*
>(data_));
308 template <
typename TS>
310 std::copy(init.begin(), init.end(),
const_cast<VT*
>(data_));
333 template <
typename TS>
347 template <
typename TS>
350 gc_ =
new Gc(1, deleter);
361 template <
typename TS>
364 gc_ =
new Gc(1, std::forward<std::function<
void(
void*)>>(deleter));
396 std::unique_ptr<VT[], aligned_deleter<T>>
411 template <
typename InIterT>
413 std::unique_ptr<VT[], aligned_deleter<T>>
447 std::size_t
size()
const {
return size_; }
450 const T*
data()
const {
return data_; }
470 operator bool()
const {
return data_ !=
nullptr; }
487 return (gc_ !=
nullptr) && (gc_->
count == 1);
496 result.gc_ = this->gc_;
523 template <
typename O>
525 std::fill_n(data_, size_, value);