Skip to content

Commit

Permalink
statically assert that template types passed to Crow are a subset of …
Browse files Browse the repository at this point in the history
…the types of the arguments passed to the constructor
  • Loading branch information
Guiorgy committed Aug 6, 2024
1 parent 9bf2f1e commit b46f6d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/crow/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@ namespace crow
template<typename... Ts>
std::tuple<Middlewares...> make_middleware_tuple(Ts&&... ts)
{
static_assert(black_magic::type_pack<Middlewares...>::template is_superset_of<Ts...>::value, "Constructor argument types must be a subset of the Crow template types");

auto fwd = std::forward_as_tuple((ts)...);
return std::make_tuple(
std::forward<Middlewares>(
Expand Down

0 comments on commit b46f6d5

Please sign in to comment.