QuickCppLib 0.10
Eliminate all the tedious hassle when making state-of-the-art C++ 14 - 23 libraries!
Loading...
Searching...
No Matches
in_place_detach_attach.hpp File Reference
#include "detach_cast.hpp"

Classes

struct  quickcpplib::_xxx::in_place_attach_detach::traits::disable_attached_for< T >
 Specialise to true if you want to attached<> to do nothing when constructed from some source T. More...
struct  quickcpplib::_xxx::in_place_attach_detach::adopt_t
class  quickcpplib::_xxx::in_place_attach_detach::attached< T >
 An RAII refinement of span<T> for automatically calling in_place_attach() and in_place_detach() on an input array of T. Move-only, detaches only on final object destruction. More...

Namespaces

namespace  quickcpplib
 The QuickCppLib namespace.
namespace  quickcpplib::_xxx
 Per commit unique namespace to prevent different git submodule versions clashing.
namespace  quickcpplib::_xxx::in_place_attach_detach
namespace  quickcpplib::_xxx::in_place_attach_detach::traits
 Namespace for user specialised traits.
namespace  quickcpplib::_xxx::in_place_attach_detach::detail

Typedefs

template<class T>
using quickcpplib::_xxx::in_place_attach_detach::detail::byte_array_wrapper = quickcpplib::_xxx::detach_cast::detail::byte_array_wrapper<T>

Functions

template<class T, typename = decltype(detach_cast(std::declval<T>()))>
constexpr auto quickcpplib::_xxx::in_place_attach_detach::in_place_detach (quickcpplib::_xxx::span::span< T > objects, detail::default_cast_operator_overload={}) noexcept
 An ADL customisation point for the in-place detachment of an array of live T objects into an array of bytes representing their detached object representations. This overload is available if detach_cast() is available for T.
template<class T, typename = decltype(attach_cast<T>(std::declval< quickcpplib::_xxx::detach_cast::byte_array_reference<T>>()))>
constexpr quickcpplib::_xxx::span::span< T > quickcpplib::_xxx::in_place_attach_detach::in_place_attach (quickcpplib::_xxx::span::span< quickcpplib::_xxx::byte::byte > bytearray, detail::default_cast_operator_overload={}) noexcept
 An ADL customisation point for the in-place attachment of previously detached object representations, back into an array of live T objects. This overload is available if attach_cast() is available for T.
template<class T, typename std::enable_if<(!detail::is_bit_cast_valid< T, detail::byte_array_wrapper< T > >() &&!traits::enable_reinterpret_attach_cast< typename std::decay< T >::type >::value), bool >::type = true>
QUICKCPPLIB_NODISCARD constexpr T & quickcpplib::_xxx::in_place_attach_detach::attach_cast (const_byte_array_reference< T > &,...) noexcept
 Reattaches a previously detached object, beginning the lifetime of the output object, and ending the lifetime of the input array of byte. All references to the input byte array become INVALID. Any use of the input array after attachment has occurred is illegal!

Variables

constexpr adopt_t quickcpplib::_xxx::in_place_attach_detach::adopt {}