Including c++ spline functions from splines2 R package


Splines2 package provides C++ header-only library integrated with Rcpp,
allowing the construction of spline basis functions directly in C++ with the help of Rcpp
and RcppArmadillo (splines2/src at master · cran/splines2 · GitHub). Seems it can be treated as one of the Rcpp packages.

Can somebody please guide me how to include them (say for example, NaturalSpline) into Stan’s function block. My ultimate aim is to use them with brms.