File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
inst/include/Rcpp/sugar/functions Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1+ 2023-02-02 Dirk Eddelbuettel <edd@debian.org>
2+
3+ * inst/include/Rcpp/sugar/functions/sapply.h: Enable compilation
4+ under C++20 (using clang++ and its C++ library) via invoke_result
5+
162023-01-29 Iñaki Ucar <iucar@fedoraproject.org>
27
38 * inst/tinytest/test_xptr.R: Fix a couple of tests writing to stdout
Original file line number Diff line number Diff line change 1- // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
2- //
1+
32// sapply.h: Rcpp R/C++ interface class library -- sapply
43//
5- // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
4+ // Copyright (C) 2010 - 2023 Dirk Eddelbuettel and Romain Francois
65//
76// This file is part of Rcpp.
87//
@@ -33,7 +32,13 @@ template <typename Function, typename SugarExpression>
3332struct sapply_application_result_of
3433{
3534#if defined(RCPP_USING_CXX0X_OR_LATER)
36- typedef typename ::std::result_of<Function(typename SugarExpression::stored_type)>::type type;
35+ #if __cplusplus < 201703L
36+ // deprecated by C++17, removed by C++2020, see https://en.cppreference.com/w/cpp/types/result_of
37+ typedef typename ::std::result_of<Function(typename SugarExpression::stored_type)>::type type;
38+ #else
39+ // since C++17, see https://en.cppreference.com/w/cpp/types/result_of
40+ typedef typename ::std::invoke_result<Function(typename SugarExpression::stored_type)>::type type;
41+ #endif
3742#else
3843 typedef typename ::Rcpp::traits::result_of<Function>::type type;
3944#endif
You can’t perform that action at this time.
0 commit comments