Skip to content

Commit 00131e2

Browse files
committed
Tidy up router static handler checks
1 parent f253440 commit 00131e2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

include/boost/http/server/router.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,10 @@ class router : public detail::router_base
488488
{
489489
static_assert(handler_crvals<H1, HN...>,
490490
"pass handlers by value or std::move()");
491-
static_assert(handler_check<7, H1, HN...>,
491+
static_assert(! handler_check<8, H1, HN...>,
492492
"cannot use exception handlers here");
493+
static_assert(handler_check<7, H1, HN...>,
494+
"invalid handler signature");
493495
add_impl(pattern, make_handlers(
494496
std::forward<H1>(h1), std::forward<HN>(hn)...));
495497
}
@@ -532,8 +534,10 @@ class router : public detail::router_base
532534
{
533535
static_assert(handler_crvals<H1, HN...>,
534536
"pass handlers by value or std::move()");
535-
static_assert(handler_check<7, H1, HN...>,
537+
static_assert(! handler_check<8, H1, HN...>,
536538
"cannot use exception handlers here");
539+
static_assert(handler_check<7, H1, HN...>,
540+
"invalid handler signature");
537541
use(std::string_view(),
538542
std::forward<H1>(h1), std::forward<HN>(hn)...);
539543
}

0 commit comments

Comments
 (0)