LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::collection_reference_type< Coll > Struct Template Reference

Trait of a type that can be used to reference the collection Coll. More...

#include "ContainerMeta.h"

Inheritance diagram for util::collection_reference_type< Coll >:
util::details::make_collection_reference_impl< std::remove_reference_t< Coll > >

Public Types

using type = std::reference_wrapper< std::remove_reference_t< Coll > >
 

Static Public Member Functions

static auto make (std::remove_reference_t< Coll > &coll)
 

Detailed Description

template<typename Coll>
struct util::collection_reference_type< Coll >

Trait of a type that can be used to reference the collection Coll.

Template Parameters
Colltype of the collection to be referenced

The goal is to have an object with access to the data of the collection of type Coll: this object should be able to be copied, but should not duplicate (copy) the data. The most versatile solution is to have a reference to Coll, and in particular std::reference_wrapper does the job. But in some special cases Coll itself will do already, as it is for a bare C pointer.

This trait describes a type with these characteristics, privileging the simplest solution.

Definition at line 99 of file ContainerMeta.h.

Member Typedef Documentation

using util::details::make_collection_reference_impl< std::remove_reference_t< Coll > , typename >::type = std::reference_wrapper<std::remove_reference_t< Coll > >
inherited

Definition at line 275 of file ContainerMeta.h.

Member Function Documentation

static auto util::details::make_collection_reference_impl< std::remove_reference_t< Coll > , typename >::make ( std::remove_reference_t< Coll > &  coll)
inlinestaticinherited

Definition at line 276 of file ContainerMeta.h.

276 { return std::ref(coll); }

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