LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::count_extracted_types< Extractor, Target, Tuple > Struct Template Reference

Counts the elements of a tuple-like type containing a Target type. More...

#include "TupleLookupByTag.h"

Inheritance diagram for util::count_extracted_types< Extractor, Target, Tuple >:
util::count_type_in_tuple< Target, extract_to_tuple_type_t< Tuple, Extractor > >

Detailed Description

template<template< typename T, typename... > class Extractor, typename Target, typename Tuple>
struct util::count_extracted_types< Extractor, Target, Tuple >

Counts the elements of a tuple-like type containing a Target type.

Template Parameters
Extractortrait exposing the target type in an element
Targetthe target type to be counted
Tuplethe tuple-like type to be investigated
See also
count_extracted_types_v, index_of_extracted_type, has_extracted_type, count_types

Given a tuple-like type Tuple, this trait returns how many of its elements "contain" the target type Target. For example:

template <typename T>
struct ExtractValueType { using type = typename T::value_type; };
using tuple_t
= std::tuple<std::vector<float>, std::vector<int>, std::list<int>>;
constexpr unsigned int nIntegerContainers
constexpr unsigned int nDoubleContainers
constexpr unsigned int nFloatContainers

nIntegerContainers will hold value 2, meaning there are two types with int as value_type. Likewise, nDoubleContainers will be 1 and nFloatContainers will be 0.

Definition at line 465 of file TupleLookupByTag.h.


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