Simple-Utility v2.3.1
Loading...
Searching...
No Matches
unique_handle.hpp File Reference
#include <compare>
#include <concepts>
#include <functional>
#include <optional>
#include <utility>
#include "Simple-Utility/Config.hpp"
#include "Simple-Utility/concepts/stl_extensions.hpp"
#include "Simple-Utility/nullables/base.hpp"
Include dependency graph for unique_handle.hpp:

Go to the source code of this file.

Classes

struct  sl::nullhandle_t
 helper type for indicating unique_handles with uninitialized state More...
 
struct  sl::default_delete_action
 default delete action for unique_handle with an empty operator () More...
 
class  sl::unique_handle< T, TDeleteAction >
 This type models some kind of std::optional behaviour but resets itself on move operations. More...
 
struct  sl::nullables::traits< unique_handle< T, TDeleteAction > >
 Specialization for unique_handle types. More...
 

Namespaces

namespace  sl
 

Concepts

concept  sl::value
 Checks whether the given template type is usable as value type for unique_handle types.
 
concept  sl::delete_action_for
 Checks whether the given template type is usable as delete action type for unique_handle types.
 

Macros

#define SL_UNIQUE_HANDLE_FULL_CONSTEXPR
 

Typedefs

using sl::bad_handle_access = std::bad_optional_access
 exception type which indicates checked access to an uninitialized value
 

Functions

template<class T , class TDeleteAction >
 sl::unique_handle (T, TDeleteAction) -> unique_handle< detail::type_t< detail::value_validator< T > >, detail::type_t< detail::delete_action_validator< T, TDeleteAction > > >
 Deduction guide for unique_handle class.
 
template<class T >
 sl::unique_handle (T) -> unique_handle< T >
 Deduction guide for unique_handle class.
 

Variables

constexpr nullhandle_t sl::nullhandle {}
 an object of type nullhandle_t
 

Macro Definition Documentation

◆ SL_UNIQUE_HANDLE_FULL_CONSTEXPR

#define SL_UNIQUE_HANDLE_FULL_CONSTEXPR