Skip to content

Commit c506cc3

Browse files
authored
Merge pull request #5083 from kunaltyagi/cpp20
2 parents fe59f84 + b277764 commit c506cc3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

common/include/pcl/common/common.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,12 @@ namespace pcl
282282
* \ingroup common
283283
*/
284284
template<typename IteratorT, typename Functor> inline auto
285-
computeMedian (IteratorT begin, IteratorT end, Functor f) noexcept -> typename std::result_of<Functor(decltype(*begin))>::type
285+
computeMedian (IteratorT begin, IteratorT end, Functor f) noexcept ->
286+
#if __cpp_lib_is_invocable
287+
std::invoke_result_t<Functor, decltype(*begin)>
288+
#else
289+
typename std::result_of<Functor(decltype(*begin))>::type
290+
#endif
286291
{
287292
const std::size_t size = std::distance(begin, end);
288293
const std::size_t mid = size/2;

0 commit comments

Comments
 (0)