OGLplus  (0.59.0) a C++ wrapper for rendering APIs

extract.hpp File Reference
#include "assert.hpp"
#include "nothing.hpp"
#include <memory>
#include <type_traits>

Go to the source code of this file.

Classes

struct  eagine::ok_traits< Outcome >
 Traits used for customization of class ok for the specified Outcome. More...
 
class  eagine::ok< Outcome >
 Value typically wrapping function call result and success indicator. More...
 

Namespaces

 eagine
 Common code is placed in this namespace.
 

Functions

template<typename T >
static constexpr auto eagine::extract (T *ptr) noexcept -> T &
 Checks ptr and dereferences it. More...
 
template<typename T >
static constexpr auto eagine::extract_or (T *ptr, std::remove_const_t< T > &fallback) noexcept -> T &
 Checks ptr and dereferences it if not null, otherwise returns fallback.
 
template<typename T , typename F >
static constexpr auto eagine::extract_or (T *ptr, F &&fallback) -> std::enable_if_t< std::is_convertible_v< F, T >, T >
 Checks ptr and dereferences it if not null, otherwise returns fallback.
 
template<typename T >
static constexpr auto eagine::extract (std::shared_ptr< T > &ptr) noexcept -> T &
 Checks ptr and dereferences it. More...
 
template<typename T >
static constexpr auto eagine::extract (const std::shared_ptr< T > &ptr) noexcept -> const T &
 Checks ptr and dereferences it. More...
 
template<typename T >
static constexpr auto eagine::extract_or (std::shared_ptr< T > &ptr, std::remove_const_t< T > &fallback) noexcept -> T &
 Checks ptr and dereferences it if not null, otherwise returns fallback.
 
template<typename T , typename F >
static constexpr auto eagine::extract_or (std::shared_ptr< T > &ptr, F &&fallback) -> std::enable_if_t< std::is_convertible_v< F, T >, T >
 Checks ptr and dereferences it if not null, otherwise returns fallback.
 
template<typename T , typename D >
static constexpr auto eagine::extract (std::unique_ptr< T, D > &ptr) noexcept -> T &
 Checks ptr and dereferences it. More...
 
template<typename T , typename D >
static constexpr auto eagine::extract (const std::unique_ptr< T, D > &ptr) noexcept -> const T &
 Checks ptr and dereferences it. More...
 
template<typename T , typename D >
static constexpr auto eagine::extract_or (std::unique_ptr< T, D > &ptr, std::remove_const_t< T > &fallback) noexcept -> T &
 Checks ptr and dereferences it if not null, otherwise returns fallback.
 
template<typename T , typename D , typename F >
static constexpr auto eagine::extract_or (std::unique_ptr< T, D > &ptr, F &&fallback) -> std::enable_if_t< std::is_convertible_v< F, T >, T >
 Checks ptr and dereferences it if not null, otherwise returns fallback.
 

Detailed Description

Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt


Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).