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

#include <box_ptr.hh>

Public Types

using pointer = typename std::unique_ptr<T>::pointer

Public Member Functions

std::add_lvalue_reference< T >::type operator* () const noexcept
pointer operator-> () const noexcept
pointer get () const noexcept
box_ptr< T > & operator= (box_ptr< T > &&other) noexcept=default
box_ptr< T > & operator= (const box_ptr< T > &)=delete
 box_ptr (box_ptr< T > &&other)=default
template<typename Other>
requires std::convertible_to<typename box_ptr<Other>::pointer, pointer> &&(!std::is_array_v<Other>)
 box_ptr (box_ptr< Other > &&other) noexcept
 box_ptr (box_ptr< T > &other)=delete
std::unique_ptr< T > take () &&

Static Public Member Functions

static box_ptr< T > unsafeFromNonnull (std::unique_ptr< T > p)

Detailed Description

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

A pointer that's like Rust's Box: forwards comparisons to the inner class and is non-null

Constructor & Destructor Documentation

◆ box_ptr()

template<typename T>
template<typename Other>
requires std::convertible_to<typename box_ptr<Other>::pointer, pointer> &&(!std::is_array_v<Other>)
nix::box_ptr< T >::box_ptr ( box_ptr< Other > && other)
inlinenoexcept

Conversion operator

Member Function Documentation

◆ unsafeFromNonnull()

template<typename T>
box_ptr< T > nix::box_ptr< T >::unsafeFromNonnull ( std::unique_ptr< T > p)
inlinestatic

Create a box_ptr from a nonnull unique_ptr.


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