atomicbox icon indicating copy to clipboard operation
atomicbox copied to clipboard

Add is_some method to AtomicOptionBox.

Open charles-r-earp opened this issue 2 years ago • 0 comments

Consider adding something like this:

impl<T> AtomicOptionBox<T> {
    pub fn is_some(&self, ordering: Ordering) -> bool;
}

It would be helpful for checking whether the box has a value without taking it. A simple use case is just for implementing Debug without exposing the box itself. Also for implementing channels and other concurrent structures.

charles-r-earp avatar May 04 '23 02:05 charles-r-earp