You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TASK-071 (B): collapse route_entry::handler variant; remove dead lambda_handler arm
route_entry::handler was originally
`std::variant<lambda_handler, shared_ptr<http_resource>>`. The
lambda_handler arm has been dead code since TASK-053: every writer
of route_entry (on_*/route entry points, register_path, register_prefix)
funnels lambdas through a lambda_resource shim and stores the shim as
shared_ptr<http_resource>. No call site stored a lambda directly, and
no v2 task introduced a writer that would. Both readers
(resolve_resource_for_request, prepare_or_create_lambda_shim) already
treated the lambda arm as unreachable.
Collapse handler to a bare shared_ptr<http_resource>:
- route_entry.hpp drops std::variant + the lambda_handler typedef;
- the lambda_handler typedef relocates to detail/lambda_resource.hpp
where its remaining uses live (the per-method slot signature);
- the dispatch site (webserver_dispatch.cpp::resolve_resource_for_request)
reads result.entry.handler directly with a defensive null check;
- prepare_or_create_lambda_shim and update_existing_v2_entry shed the
std::get_if indirection;
- the routing_regression unit pin updates likewise.
Pin the new shape with a static_assert in webserver_on_methods_test:
TASK-071 history is captured in the assertion message so a future
reintroduction of variant storage trips an early-warning canary at
compile time. The webserver::route(...) and on_*(...) public
signatures take std::function (not std::variant) and were unaffected
— no Doxygen update needed on the public surface.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments