Skip to content

Commit

Permalink
Merge pull request #43 from CaseyCarter/issue_239
Browse files Browse the repository at this point in the history
Implement PR for ericniebler/stl2#239:
  • Loading branch information
CaseyCarter authored Oct 27, 2016
2 parents b119ac7 + 2e48160 commit 2f6a4d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/stl2/detail/concepts/callable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ STL2_OPEN_NAMESPACE {
// Not to spec: The function type must be decayed before being constrained.
template <class F, class...Is>
requires
models::IndirectCallable<remove_reference_t<F>, Is...>
models::IndirectCallable<decay_t<F>, Is...>
struct indirect_result_of<F(Is...)>
: result_of<F(reference_t<Is>...)> {};

Expand Down
8 changes: 8 additions & 0 deletions test/concepts/iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -262,6 +264,12 @@ namespace indirectly_callable_test {
CONCEPT_ASSERT(models::IndirectCallable<std::plus<int>, int*, int*>);
}

namespace indirect_result_of_test {
template <class R, class... Args>
using fn_t = R(Args...);
CONCEPT_ASSERT(models::Same<ns::indirect_result_of_t<fn_t<void, int>&(const int*)>, void>);
}

int main() {
return ::test_result();
}

0 comments on commit 2f6a4d0

Please sign in to comment.