Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::ref< T > Class Template Reference

#include <ref.hh>

Public Member Functions

 ref (const ref< T > &r)
template<std::derived_from< std::enable_shared_from_this< T > > T2>
 ref (T2 &r)
T * operator-> () const
T & operator* () const
 operator std::shared_ptr< T > () const
std::shared_ptr< T > get_ptr () const
template<typename T2>
std::optional< ref< T2 > > try_cast () const
template<typename T2>
std::shared_ptr< T2 > try_cast_shared () const
template<typename T2>
 operator ref< T2 > () const
ref< T > & operator= (ref< T > const &rhs)=default
bool operator== (const ref< T > &other) const
bool operator!= (const ref< T > &other) const
bool operator< (const ref< T > &other) const

Static Public Member Functions

static ref< T > unsafeFromPtr (const std::shared_ptr< T > &p)

Friends

template<typename T2, typename... Args>
ref< T2 > make_ref (Args &&... args)

Detailed Description

template<typename T>
class nix::ref< T >

A simple non-nullable reference-counted pointer. Actually a wrapper around std::shared_ptr that prevents null constructions.


The documentation for this class was generated from the following file: