Usethis: use_cpp11, use_cpp14, use_cpp17

Created on 10 Mar 2018  路  8Comments  路  Source: r-lib/usethis

I can't never remember what I have to do for variants of C++.
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-C_002b_002b11-code
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-C_002b_002b14-code
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-C_002b_002b17-code

Should I make the relevant use_cpp_ functions ?

code description feature help wanted

Most helpful comment

I'm putting this in the backlog w.r.t. preparing the release of v1.5.0. If anyone has immediate plans to move on this, let me know.

All 8 comments

Sounds good to me! cc @hadley @jimhester

might be an argument to use_rcpp or standalone functions, or both.
Using C++ does not necessarily mean using Rcpp.

Random API thoughts:

You don't _have_ to use Rcpp with C++, but it's certainly the most common way, so I wouldn't expend much effort on an API that doesn't use Rcpp (and looking at use_rcpp() there's really not much there).

We probably should extract out a use_src() which would do:

use_directory("src")
use_git_ignore(c("*.o", "*.so", "*.dll"), "src")

We may also extend use_rcpp() to take a name (a la #117).

This is somewhat orthogonal to Rcpp or not Rcpp, and more about when you want to use some C++ standard with or without Rcpp.

This would be an ideal extension candidate for the use_makevars() function sitting in #601. With this being said, the present implementation would require more versatility by parseing the file in a similar way to the DESCRIPTION parser used by use_description() to check for duplicates. One step at a time though...

I'm putting this in the backlog w.r.t. preparing the release of v1.5.0. If anyone has immediate plans to move on this, let me know.

@jennybc no immediate plan to move on this. I'll likely have cycles in summer/fall to develop a makevars parser package similar to desc.

Might also be worth noting @jeroen's makeconf package does wonders for understanding a user's compile options.

Just added use_cpp11() in 194db5be028f45f59239b8cdbde2bb1866f4bf50. It doesn't feel like we have any highly specific, near terms plans to do more in this area.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uribo picture uribo  路  5Comments

hadley picture hadley  路  3Comments

pieterjanvc picture pieterjanvc  路  5Comments

aosmith16 picture aosmith16  路  5Comments

chris-billingham picture chris-billingham  路  5Comments