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

Computes the minimum value from a container-like object at compile time. More...

#include <algorithms.hpp>

Public Types

using type = typename decltype(e)::value_type
 The type of the elements in the container.

Static Public Attributes

static constexpr std::size_t size = e.size()
 The size of the container.
static constexpr auto value
 The minimum value computed at compile time from the container.

Detailed Description

template<auto e>
requires (concepts::Container<std::remove_cv_t<decltype(e)>>)
struct templa::algorithms::min_from< e >

Computes the minimum value from a container-like object at compile time.

Accepts a container-like expression (e.g., std::array, std::vector constexpr) and computes the minimum element value at compile-time by unpacking it.

Template Parameters
eA container expression with random access and known size. @requires The container must satisfy the concepts::Container constraint.

Member Data Documentation

◆ value

template<auto e>
auto templa::algorithms::min_from< e >::value
staticconstexpr
Initial value:
=
[]<std::size_t... I>(std::index_sequence<I...>) consteval noexcept
{
return min<e[I]...>::value;
}(std::make_index_sequence<size>{})
static constexpr auto value
The maximum value computed at compile time from the container.
Definition algorithms.hpp:244
Computes the minimum value among a pack of compile-time constants.
Definition algorithms.hpp:150

The minimum value computed at compile time from the container.

Uses the min struct to evaluate the minimum by unpacking the container.


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