Skip to content

Commit

Permalink
Strip const and & from value_type. (#559)
Browse files Browse the repository at this point in the history
See #558.  MSVC in C++20 or C++23 mode complains without this.
  • Loading branch information
jtv authored Apr 9, 2022
1 parent 134f593 commit 69a5d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/pqxx/types.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ using strip_t = std::remove_cv_t<std::remove_reference_t<TYPE>>;
* which we may or may not end up using for this.
*/
template<std::ranges::range CONTAINER>
using value_type = decltype(*std::begin(std::declval<CONTAINER>()));
using value_type = strip_t<decltype(*std::begin(std::declval<CONTAINER>()))>;
#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<typename CONTAINER>
using value_type = decltype(*std::begin(std::declval<CONTAINER>()));
using value_type = strip_t<decltype(*std::begin(std::declval<CONTAINER>()))>;
#endif // PQXX_HAVE_CONCEPTS


Expand Down

0 comments on commit 69a5d93

Please sign in to comment.