Declare lambda functions as constexpr

Signed-off-by: Anjan Roy <hello@itzmeanjan.in>
This commit is contained in:
Anjan Roy
2024-09-01 23:13:58 +04:00
parent 0f2849520b
commit 53c0afa644

View File

@@ -2,5 +2,5 @@
#include <algorithm>
#include <vector>
const auto compute_min = [](const std::vector<double>& v) -> double { return *std::min_element(v.begin(), v.end()); };
const auto compute_max = [](const std::vector<double>& v) -> double { return *std::max_element(v.begin(), v.end()); };
constexpr auto compute_min = [](const std::vector<double>& v) -> double { return *std::min_element(v.begin(), v.end()); };
constexpr auto compute_max = [](const std::vector<double>& v) -> double { return *std::max_element(v.begin(), v.end()); };