stan-dev / stanc3

The Stan transpiler (from Stan to C++ and beyond).
BSD 3-Clause "New" or "Revised" License
138 stars 44 forks source link

[FR] Variadic signatures with external c++ #1348

Open andrjohns opened 10 months ago

andrjohns commented 10 months ago

Currently the only way to specify/use a variadic signature in Stan is by adding it to stanc3, but it would be great for prototyping if it was possible to specify a variadic signature for an external c++ function.

In other words, for the forward declaration:

functions {
  real testing(real x, ...);
}

To transpile to something like:

template <typename T, typename... TArgs, require_stan_scalar_t<T>* = nullptr>
T testing(const T& x, const TArgs&... args);
WardBrian commented 10 months ago

This would be a bit tricky to implement I think. What use case do you have in mind?