Module CCRef
References
- since
- 0.9
type 'a printer
= Stdlib.Format.formatter -> 'a -> unit
type 'a ord
= 'a -> 'a -> int
type 'a eq
= 'a -> 'a -> bool
type 'a iter
= ('a -> unit) -> unit
type 'a t
= 'a Stdlib.ref
val create : 'a -> 'a t
Alias to
ref
.
val iter : ('a -> unit) -> 'a t -> unit
Call the function on the content of the reference.
val update : ('a -> 'a) -> 'a t -> unit
Update the reference's content with the given function.
val incr_then_get : int t -> int
incr_then_get r
incrementsr
and returns its new value, think++r
.- since
- 0.17
val get_then_incr : int t -> int
get_then_incr r
incrementsr
and returns its old value, thinkr++
.- since
- 0.17