From 2e48160b3ac8d760c1610f029194fb523c62db54 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 27 Oct 2016 11:42:47 -0700 Subject: [PATCH] Implement PR for ericniebler/stl2#239: In indirect_result_of, decay the type of the function before passing to IndirectCallable. --- include/stl2/detail/concepts/callable.hpp | 2 +- test/concepts/iterator.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/stl2/detail/concepts/callable.hpp b/include/stl2/detail/concepts/callable.hpp index c4add1d9b..750a0e0e4 100644 --- a/include/stl2/detail/concepts/callable.hpp +++ b/include/stl2/detail/concepts/callable.hpp @@ -87,7 +87,7 @@ STL2_OPEN_NAMESPACE { // Not to spec: The function type must be decayed before being constrained. template requires - models::IndirectCallable, Is...> + models::IndirectCallable, Is...> struct indirect_result_of : result_of...)> {}; diff --git a/test/concepts/iterator.cpp b/test/concepts/iterator.cpp index da4161696..65633e7cd 100644 --- a/test/concepts/iterator.cpp +++ b/test/concepts/iterator.cpp @@ -74,6 +74,8 @@ namespace ns { using ranges::forward_iterator_tag; using ranges::bidirectional_iterator_tag; using ranges::random_access_iterator_tag; + + using ranges::indirect_result_of_t; } #elif VALIDATE_STL2 @@ -262,6 +264,12 @@ namespace indirectly_callable_test { CONCEPT_ASSERT(models::IndirectCallable, int*, int*>); } +namespace indirect_result_of_test { + template + using fn_t = R(Args...); + CONCEPT_ASSERT(models::Same&(const int*)>, void>); +} + int main() { return ::test_result(); }