From 14fd4c6d5b2b1fd3cba9f691d6d4b41640cdb42d Mon Sep 17 00:00:00 2001 From: Chuvi Date: Wed, 4 Aug 2021 13:54:46 +0300 Subject: [PATCH 1/2] Fix std::min conflict with min/max definitions from windows.h --- include/argparse/argparse.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index ad8d8bea..22e25692 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -99,7 +99,7 @@ template std::string repr(T const &val) { out << repr(*val.begin()); std::for_each( std::next(val.begin()), - std::next(val.begin(), std::min(size, repr_max_container_size) - 1), + std::next(val.begin(), (std::min)(size, repr_max_container_size) - 1), [&out](const auto &v) { out << " " << repr(v); }); if (size <= repr_max_container_size) out << " "; From 06524964352645acf9c283f7b748ada04371472b Mon Sep 17 00:00:00 2001 From: Chuvi Date: Wed, 4 Aug 2021 19:43:20 +0300 Subject: [PATCH 2/2] Use std::min type specialisation --- include/argparse/argparse.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index 22e25692..f36e436a 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -99,7 +99,7 @@ template std::string repr(T const &val) { out << repr(*val.begin()); std::for_each( std::next(val.begin()), - std::next(val.begin(), (std::min)(size, repr_max_container_size) - 1), + std::next(val.begin(), std::min(size, repr_max_container_size) - 1), [&out](const auto &v) { out << " " << repr(v); }); if (size <= repr_max_container_size) out << " ";