mdds
Loading...
Searching...
No Matches
mdds::mtv::clone_block< BlockT, std::void_t< decltype(clone_value< typename BlockT::value_type >{})> > Struct Template Reference

#include <types.hpp>

Public Types

using store_type = typename BlockT::store_type
using value_type = typename BlockT::value_type
using CV = clone_value<value_type>

Public Member Functions

template<typename... Passed>
BlockT * operator() (const BlockT &src, Passed &... passed) const

Detailed Description

template<typename BlockT>
requires (!std::copy_constructible<BlockT>)
struct mdds::mtv::clone_block< BlockT, std::void_t< decltype(clone_value< typename BlockT::value_type >{})> >

Specialization for non-copyable element block type with valid clone_value specialization for the value type of the block.

Unless the clone_value specialization declares an exec_policy, the values are cloned by a single function object instance strictly in the same order as they are stored in the source, and an exception thrown mid-way destroys the partially built destination block, which for managed blocks also deletes the values cloned so far.

Parameters
<BlockT>Element block type which must be non-copyable.

Member Function Documentation

◆ operator()()

template<typename BlockT>
template<typename... Passed>
BlockT * mdds::mtv::clone_block< BlockT, std::void_t< decltype(clone_value< typename BlockT::value_type >{})> >::operator() ( const BlockT & src,
Passed &... passed ) const
inline

Clone a block. By default a new clone_value instance is created to clone the values of the block. If the caller passes clone_value instances and one of them is of the clone_value type of this block, the values are cloned through that instance instead, which lets it carry state across the blocks it is passed to. Passed instances of other clone_value types are ignored.

Parameters
srcBlock to clone.
passedCaller-passed clone_value instances.
Returns
Cloned block.