Currently the route_handler concept (which is used by router::add to constrain the callback type) only checks for invocable with the request and optionally the capture results. This is an incomplete definition as the type must also return a response<...> when invocked with said arguments.
The current lack of this additional requirement in the concept means that the user is presented with a rather obscure template error about void if their function does not have a return type (e.g. a default lambda) and which I spent a few minutes staring at before I realised the issue (bearing in mind I wrote that code in the first place :p).
This is mostly for tracking
Currently the
route_handler
concept (which is used byrouter::add
to constrain the callback type) only checks for invocable with the request and optionally the capture results. This is an incomplete definition as the type must also return aresponse<...>
when invocked with said arguments.The current lack of this additional requirement in the concept means that the user is presented with a rather obscure template error about
void
if their function does not have a return type (e.g. a default lambda) and which I spent a few minutes staring at before I realised the issue (bearing in mind I wrote that code in the first place :p).