KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::internal::has_no_unused_parameters< RequiredParametersTuple, OptionalParametersTuple, Args > Struct Template Reference

Struct wrapping a check that verifies that no unused parameters are part of the arguments. More...

#include <named_parameter_check.hpp>

Public Types

using all_available_parameters = decltype(std::tuple_cat(RequiredParametersTuple{}, OptionalParametersTuple{}))
 Concatenation of required and optional parameters.
 

Static Public Member Functions

template<size_t... Indices>
static constexpr auto number_distinct_parameters (std::index_sequence< Indices... > indices)
 Get total number of different parameters (passed, required, and optional).
 

Static Public Attributes

static constexpr bool assertion
 true if and only if no unused parameter can be found in Args.
 

Detailed Description

template<typename RequiredParametersTuple, typename OptionalParametersTuple, typename... Args>
struct kamping::internal::has_no_unused_parameters< RequiredParametersTuple, OptionalParametersTuple, Args >

Struct wrapping a check that verifies that no unused parameters are part of the arguments.

Template Parameters
RequiredParametersTupleAll required kamping::internal::ParameterType passed as std::integral_constant in an std::tuple.
OptionalParametersTupleAll optional kamping::internal::ParameterType passed as std::integral_constant in an std::tuple.
ArgsArguments passed to the function that calls this check, i.e., the different parameters.

Member Function Documentation

◆ number_distinct_parameters()

template<size_t... Indices>
static constexpr auto kamping::internal::has_no_unused_parameters< RequiredParametersTuple, OptionalParametersTuple, Args >::number_distinct_parameters ( std::index_sequence< Indices... > indices)
inlinestaticconstexpr

Get total number of different parameters (passed, required, and optional).

This check works similar to has_all_required_parameters. Here, we "iterate" over all parameters, i.e., RequiredParametersTuple and OptionalParametersTuple and check which parameters are not(!) passed as Args. Then, we add this number to the size of Args. If this number is greater than the total number of (required and optional) parameters, there are unused parameters.

Template Parameters
IndicesIndex sequence used to unpack all required parameters in ParametersTuple.
Parameters
indicesThe parameter is only required to deduce the template parameter.
Returns
The number of different parameters (passed, optional, and required).

Member Data Documentation

◆ assertion

Initial value:
=
(std::tuple_size_v<all_available_parameters> >= number_distinct_parameters(
std::make_index_sequence<std::tuple_size_v<all_available_parameters>>{}
))
static constexpr auto number_distinct_parameters(std::index_sequence< Indices... > indices)
Get total number of different parameters (passed, required, and optional).
Definition named_parameter_check.hpp:310

true if and only if no unused parameter can be found in Args.


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