From 69a5d93c9c5870aeb14f489d4bffdc9dec9e1791 Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Sat, 9 Apr 2022 20:25:20 +0200 Subject: [PATCH] Strip `const` and `&` from `value_type`. (#559) See #558. MSVC in C++20 or C++23 mode complains without this. --- NEWS | 1 + include/pqxx/types.hxx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 7aa72a273..3da4ecae6 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ - Disallow nesting of `ignore-deprecated` blocks. - Deprecate `exec` functions' `desc` parameter. - Fix `placeholders` documentation. (#557) + - Strip `const` and references from `value_type`. (#558) 7.7.2 - Fix up damage done by auto-formatting. 7.7.1 diff --git a/include/pqxx/types.hxx b/include/pqxx/types.hxx index 5d0df676b..f95b598f8 100644 --- a/include/pqxx/types.hxx +++ b/include/pqxx/types.hxx @@ -97,14 +97,14 @@ using strip_t = std::remove_cv_t>; * which we may or may not end up using for this. */ template -using value_type = decltype(*std::begin(std::declval())); +using value_type = strip_t()))>; #else // PQXX_HAVE_CONCEPTS /// The type of a container's elements. /** At the time of writing there's a similar thing in `std::experimental`, * which we may or may not end up using for this. */ template -using value_type = decltype(*std::begin(std::declval())); +using value_type = strip_t()))>; #endif // PQXX_HAVE_CONCEPTS