mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
parent
197b4e7f1b
commit
f8d9e33900
2 changed files with 6 additions and 2 deletions
|
|
@ -236,10 +236,10 @@ let pop_ i (m:'a t) : 'a * 'a t =
|
|||
|
||||
let pop_exn (v:'a t) : 'a * 'a t =
|
||||
if v.size=0 then failwith "Fun_vec.pop_exn";
|
||||
pop_ v.size v
|
||||
pop_ (v.size-1) v
|
||||
|
||||
let pop (v:'a t) : ('a * 'a t) option =
|
||||
if v.size=0 then None else Some (pop_ v.size v)
|
||||
if v.size=0 then None else Some (pop_ (v.size-1) v)
|
||||
|
||||
let iteri ~f (m : 'a t) : unit =
|
||||
(* basically, a 32-way BFS traversal.
|
||||
|
|
|
|||
|
|
@ -72,6 +72,10 @@ val get_exn : int -> 'a t -> 'a
|
|||
val pop_exn : 'a t -> 'a * 'a t
|
||||
(** Pop last element. *)
|
||||
|
||||
val pop : 'a t -> ('a * 'a t) option
|
||||
(** Pop last element.
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
val iter : f:('a -> unit) -> 'a t -> unit
|
||||
|
||||
val iteri : f:(int -> 'a -> unit) -> 'a t -> unit
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue