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

\item{key}{Query key.}
}
\value{
A list with fields:
\itemize{
\item \code{found}: logical flag.
\item \code{index}: one-based position of the first match, or \code{NULL}.
\item \code{value}: matched element, or \code{NULL}.
\item \code{key}: matched key, or \code{NULL}.
}
}
\description{
Find First Element with Key \code{>} Query
}
\details{
\code{upper_bound()} finds the first element with key \verb{> key}. This skips exact
key matches, which is useful for exclusive range endpoints and for finding
the position immediately after a duplicate-key run.
}
\examples{
x <- ordered_sequence("a", "b", "c", keys = c(1, 2, 2))
upper_bound(x, 2)
upper_bound(x, 10)
}
\seealso{
\code{\link[=lower_bound]{lower_bound()}}
}
