Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2023-02-02 Dirk Eddelbuettel <edd@debian.org>

* inst/include/Rcpp/sugar/functions/sapply.h: Enable compilation
under C++20 (using clang++ and its C++ library) via invoke_result

2023-01-29 Iñaki Ucar <iucar@fedoraproject.org>

* inst/tinytest/test_xptr.R: Fix a couple of tests writing to stdout
Expand Down
13 changes: 9 additions & 4 deletions inst/include/Rcpp/sugar/functions/sapply.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
//

// sapply.h: Rcpp R/C++ interface class library -- sapply
//
// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2010 - 2023 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -33,7 +32,13 @@ template <typename Function, typename SugarExpression>
struct sapply_application_result_of
{
#if defined(RCPP_USING_CXX0X_OR_LATER)
typedef typename ::std::result_of<Function(typename SugarExpression::stored_type)>::type type;
#if __cplusplus < 201703L
// deprecated by C++17, removed by C++2020, see https://en.cppreference.com/w/cpp/types/result_of
typedef typename ::std::result_of<Function(typename SugarExpression::stored_type)>::type type;
#else
// since C++17, see https://en.cppreference.com/w/cpp/types/result_of
typedef typename ::std::invoke_result<Function, typename SugarExpression::stored_type>::type type;
#endif
#else
typedef typename ::Rcpp::traits::result_of<Function>::type type;
#endif
Expand Down