mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
Changed pop_into container a template.
This commit is contained in:
parent
c6e1e9ac00
commit
892009458b
@ -397,10 +397,12 @@ namespace etl
|
||||
|
||||
//*************************************************************************
|
||||
/// Gets the oldest value and removes it from the front of the queue and
|
||||
/// pushes it to the destination queue.
|
||||
/// pushes it to the destination container.
|
||||
/// If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty.
|
||||
/// NOTE: The destination must support a push(T) member function.
|
||||
//*************************************************************************
|
||||
void pop_into(iqueue& destination)
|
||||
template <typename TContainer>
|
||||
void pop_into(TContainer& destination)
|
||||
{
|
||||
destination.push(front());
|
||||
pop();
|
||||
|
||||
@ -362,10 +362,11 @@ namespace etl
|
||||
|
||||
//*************************************************************************
|
||||
/// Removes the oldest item from the top of the stack and pushes it to the
|
||||
/// top of the destination stack.
|
||||
/// NOTE: This reverses the stack order.
|
||||
/// destination container.
|
||||
/// NOTE: The destination must support a push(T) member function.
|
||||
//*************************************************************************
|
||||
void pop_into(istack& destination)
|
||||
template <typename TContainer>
|
||||
void pop_into(TContainer& destination)
|
||||
{
|
||||
destination.push(top());
|
||||
pop();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user