% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/50-ordered_sequence-ops.R
\name{pop_all_key}
\alias{pop_all_key}
\title{Pop All Elements for One Key}
\usage{
pop_all_key(x, key)
}
\arguments{
\item{x}{An \code{ordered_sequence}.}

\item{key}{Query key.}
}
\value{
A list with fields:
\itemize{
\item \code{elements}: \code{ordered_sequence} of removed matches.
\item \code{remaining}: \code{ordered_sequence} after removal.
}
}
\description{
Removes and returns all elements whose key equals \code{key}.
}
\details{
Use \code{\link[=as.list]{as.list()}} to convert \code{elements} to a standard R list.
}
\examples{
x <- ordered_sequence("a", "b", "c", keys = c(1, 2, 2))
out <- pop_all_key(x, 2)
as.list(out$elements)
out$remaining
}
