Templa 0.0.1-alpha
C++ Metaprogramming Utilities
Loading...
Searching...
No Matches
templa::algorithms::max< Es > Struct Template Reference

Computes the maximum value among a pack of compile-time constants. More...

#include <algorithms.hpp>

Inheritance diagram for templa::algorithms::max< Es >:
templa::internal::uniform_element_identity< Es... >

Public Types

using identity_type = typename templa::internal::uniform_element_identity<Es...>
 The type that provides the uniform container of values.
Public Types inherited from templa::internal::uniform_element_identity< Es... >
using uniform_type
 Type alias for the uniform std::array of elements.
using value_type
 Value type of the uniform_type.

Static Public Attributes

static constexpr value_type value
 The maximum value among the compile-time constants.
Static Public Attributes inherited from templa::internal::uniform_element_identity< Es... >
static constexpr std::size_t size
 Number of elements.
static constexpr bool valid
 Check if all elements have the same decayed type and are comparable.
static constexpr uniform_type identity_value
 Static array holding the elements.

Detailed Description

template<auto... Es>
struct templa::algorithms::max< Es >

Computes the maximum value among a pack of compile-time constants.

Inherits from templa::internal::uniform_element_identity to extract and store the values in a uniform container, then determines the maximum using std::max_element.

Template Parameters
EsThe pack of compile-time constant values.

Member Data Documentation

◆ value

template<auto... Es>
value_type templa::algorithms::max< Es >::value
staticconstexpr
Initial value:
=
*std::max_element(identity_type::identity_value.begin(), identity_type::identity_value.end(),
[](const value_type &a, const value_type &b)
{ return a < b; })
typename uniform_type::value_type value_type
Definition pack.hpp:147

The maximum value among the compile-time constants.


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