I've just started to use sphinx with a C++ and I like it well enough, but I am getting a bit nervous that things are going to start falling apart because it doesn't seem to be able to handle gnarlier signatures.
I'm aware of doxygen + exhale + sphinx but that is not really a route I want to go down.
As an example, this is a perfectly valid, compilable function signature:
template<
typename T,
typename = std::enable_if_t<std::is_integral_v<T>, T>
>
T getIntegralArg (
const std::string& str,
const char ch = '\0',
const std::string& errmsg = "Invalid argument",
T unset = (T)0
)
I've put that like this in the documentation (the break/ident pattern works fine w/ other stuff, and putting the sig all on one line doesn't make any difference):
.. cpp:function:: template<typename T, typename = std::enable_if_t<std::is_integral_v<T>, T>> \
T getIntegralArg (const std::string& str, const char ch = '\0', \
const std::string& errmsg = "Invalid argument", T unset = (T)0)
:noindex:
The problem (or a symptom thereof) is that `:noindex` is interpreted literally and gets printed after the signature. This also means I cannot use `:tparam-line-spec:`, which would be handy here. The actual error is:
If the function has no return type:
Error in declarator or parameters and qualifiers
Invalid definition: Expected identifier in nested name. [error at 0]
:noindex:
^
Although the end product is not too zany (the actual function name is emphasized, as are the params), I'm worried more symptoms of this will keep popping up, and not being able to use `:noindex` there is a real problem. I'd feel a little less like I'm being led down a garden path into the dark woods if I knew the C++ domain had been used for something beyond the trivial. I've searched around a bit online and glanced over the list of projects pages but nothing jumps out at me.
Is anyone aware of a non-trivial, open source C++ project (as in, actual software project, not a book about C++, etc.) that uses Sphinx and reStructuredText alone (ie., not chained to Doxygen and Exhale)? It doesn't have to be open source as long as the documentation sources are available.
While I'm here if anyone has any ideas about getting around the problem, that would be great. Ideally it would be nice if there were the option to manually break this down and indicate with markup the params, default values, etc. Have I missed something there?