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

\item{key}{Query key.}
}
\value{
A list with fields:
\itemize{
\item \code{value}: removed element, or \code{NULL} on miss.
\item \code{key}: removed key, or \code{NULL} on miss.
\item \code{remaining}: ordered sequence after removal.
}
}
\description{
Removes and returns the first element whose key equals \code{key}.
}
\details{
For duplicate keys, the first element in stable sequence order is removed.
}
\examples{
x <- ordered_sequence("a", "b", "c", keys = c(1, 2, 2))
out <- pop_key(x, 2)
out$value
out$remaining
pop_key(x, 10)
}
