From c2d250fd1c02f7702784ac6c250018bbc3cd002b Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 16 Oct 2020 20:09:56 +0200 Subject: Use std::void_t instead of the hand-rolled version Change-Id: Ibcf0e3d32f05b95f5f1996a071a50bc0eba1ae61 Reviewed-by: Volker Hilsheimer --- src/corelib/tools/qcontainertools_impl.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qcontainertools_impl.h b/src/corelib/tools/qcontainertools_impl.h index caac5a07e8..0f9225e461 100644 --- a/src/corelib/tools/qcontainertools_impl.h +++ b/src/corelib/tools/qcontainertools_impl.h @@ -106,11 +106,7 @@ void reserveIfForwardIterator(Container *c, ForwardIterator f, ForwardIterator l c->reserve(static_cast(std::distance(f, l))); } -// for detecting expression validity -template -using void_t = void; - -template > +template > struct AssociativeIteratorHasKeyAndValue : std::false_type { }; @@ -118,14 +114,14 @@ struct AssociativeIteratorHasKeyAndValue : std::false_type template struct AssociativeIteratorHasKeyAndValue< Iterator, - void_t().key()), - decltype(std::declval().value())> + std::void_t().key()), + decltype(std::declval().value())> > : std::true_type { }; -template , typename = void_t<>> +template , typename = std::void_t<>> struct AssociativeIteratorHasFirstAndSecond : std::false_type { }; @@ -133,8 +129,8 @@ struct AssociativeIteratorHasFirstAndSecond : std::false_type template struct AssociativeIteratorHasFirstAndSecond< Iterator, - void_t()->first), - decltype(std::declval()->second)> + std::void_t()->first), + decltype(std::declval()->second)> > : std::true_type { -- cgit v1.2.3