Skip to content

[R-package] use C++17 in the CRAN package#5690

Merged
jameslamb merged 14 commits intomasterfrom
r/cpp17
Mar 7, 2023
Merged

[R-package] use C++17 in the CRAN package#5690
jameslamb merged 14 commits intomasterfrom
r/cpp17

Conversation

@jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Jan 28, 2023

Proposes using the C++17 standard in the CRAN build of the R package.

Motivation

CRAN recently started raising the following NOTE on r-devel.

Result: NOTE
Specified C++11: please update to current default of C++17

(https://cran.r-project.org/web/checks/check_results_lightgbm.html)

That check just made it into R about 2 days ago (commit link), in preparation for C++17 becoming the default C++ standard in R's next release, v4.3.0.

So I expect that CRAN is going to ask us to make this change soon.

Implications of this change

If this PR is accepted,

  • any C++ code included in the R package will need to conform to the C++17 standard
    • that includes most of src/, include/ and external_libs/
    • that means, for example, not using features removed in C++14/C++17 like std::auto_ptr and std::random_shuffle (docs)
  • the CRAN package will no longer be compilable with compilers that don't support C++17

@jameslamb jameslamb changed the title WIP: [R-package] use C++17 in the CRAN package [R-package] use C++17 in the CRAN package Jan 29, 2023
@jameslamb jameslamb marked this pull request as ready for review January 29, 2023 04:43
@jameslamb
Copy link
Collaborator Author

@guolinke @jmoralez could I please get a review on this proposal when you have time?

@jameslamb jameslamb requested a review from guolinke February 16, 2023 15:27
@jameslamb jameslamb merged commit 98c1db7 into master Mar 7, 2023
@jameslamb jameslamb deleted the r/cpp17 branch March 7, 2023 03:57
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues
including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants