Skip to content

spiraldb/arcref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arcref

A smart pointer type that can wrap either a &'static T or an Arc<T>.

Equality

ArcRef<T> implements PartialEq by checking pointer identity first. If two ArcRefs point at the same backing allocation or the same &'static reference, they compare equal without calling T's PartialEq implementation. Otherwise, equality falls back to comparing the dereferenced values.

This means cloned ArcRefs are always equal to each other, and equality remains reflexive even for wrapped types whose PartialEq is not, such as f64::NAN.

See the examples/ folder for example usage.

About

🦀 &'static T | Arc<T>

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages