richfitz/RcppR6

Separate .cpp and .hpp files

Closed this issue · 2 comments

Hi Rich,

Fantastic package! It has helped so much in my projects.

Do you have any examples of using separate .hpp and .cpp for classes? I tried looking in the example packages as well as the plant package that uses RcppR6 and didn't find anything.

In plant we have separate header and cpp files:

headers: https://github.com/traitecoevo/plant/tree/master/inst/include/plant
implementation: https://github.com/traitecoevo/plant/tree/master/src

Was there something more specific you are looking to do?

@richfitz I didn't realize the .cpp and .hpp files were split between inst/ for headers and src/ for implementation (I assumed they were both in inst/ and the src/ held free-floating function definitions like people normally do in Rcpp packages), thank you for pointing that out!!