[NFC][pstl] Remove unused utility code

llvm-svn: 365346
This commit is contained in:
Louis Dionne 2019-07-08 16:35:49 +00:00
parent 498687bff2
commit c862ea27b7
1 changed files with 0 additions and 84 deletions

View File

@ -136,90 +136,6 @@ struct __serial_move_merge
}
};
template <typename _RandomAccessIterator1, typename _OutputIterator>
void
__init_buf(_RandomAccessIterator1 __xs, _RandomAccessIterator1 __xe, _OutputIterator __zs, bool __bMove)
{
const _OutputIterator __ze = __zs + (__xe - __xs);
typedef typename std::iterator_traits<_OutputIterator>::value_type _ValueType;
if (__bMove)
{
// Initialize the temporary buffer and move keys to it.
for (; __zs != __ze; ++__xs, ++__zs)
new (&*__zs) _ValueType(std::move(*__xs));
}
else
{
// Initialize the temporary buffer
for (; __zs != __ze; ++__zs)
new (&*__zs) _ValueType;
}
}
// TODO is this actually used anywhere?
template <typename _Buf>
class __stack
{
typedef typename std::iterator_traits<decltype(_Buf(0).get())>::value_type _ValueType;
typedef typename std::iterator_traits<_ValueType*>::difference_type _DifferenceType;
_Buf _M_buf;
_ValueType* _M_ptr;
_DifferenceType _M_maxsize;
__stack(const __stack&) = delete;
void
operator=(const __stack&) = delete;
public:
__stack(_DifferenceType __max_size) : _M_buf(__max_size), _M_maxsize(__max_size) { _M_ptr = _M_buf.get(); }
~__stack()
{
assert(size() <= _M_maxsize);
while (!empty())
pop();
}
const _Buf&
buffer() const
{
return _M_buf;
}
size_t
size() const
{
assert(_M_ptr - _M_buf.get() <= _M_maxsize);
assert(_M_ptr - _M_buf.get() >= 0);
return _M_ptr - _M_buf.get();
}
bool
empty() const
{
assert(_M_ptr >= _M_buf.get());
return _M_ptr == _M_buf.get();
}
void
push(const _ValueType& __v)
{
assert(size() < _M_maxsize);
new (_M_ptr) _ValueType(__v);
++_M_ptr;
}
const _ValueType&
top() const
{
return *(_M_ptr - 1);
}
void
pop()
{
assert(_M_ptr > _M_buf.get());
--_M_ptr;
(*_M_ptr).~_ValueType();
}
};
} // namespace __utils
} // namespace __pstl