From 8bacfde0c1b4dd9a8369ba946ab1ba8e1df9e216 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 9 Mar 2025 15:56:08 +0100 Subject: [PATCH] Use named_parameter_t from Seafire::Server --- seafire/routing/host-parameter.hxx | 11 +++-------- seafire/routing/route-parameter.hxx | 11 +++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/seafire/routing/host-parameter.hxx b/seafire/routing/host-parameter.hxx index 6cd87a7..5a79e1c 100644 --- a/seafire/routing/host-parameter.hxx +++ b/seafire/routing/host-parameter.hxx @@ -16,23 +16,18 @@ namespace seafire::routing typename ParameterType = server::string_parameter_t > class host_parameter_t + : public server::named_parameter_t { public: using parameter_type = ParameterType; using value_type = typename parameter_type::value_type; - static - std::string const& - name() - { - static std::string const name{Name}; - return name; - } - host_parameter_t(std::optional value) : _value{std::move(value)} {} + using server::named_parameter_t::name; + std::optional const& value() const { diff --git a/seafire/routing/route-parameter.hxx b/seafire/routing/route-parameter.hxx index f91d036..564742a 100644 --- a/seafire/routing/route-parameter.hxx +++ b/seafire/routing/route-parameter.hxx @@ -16,23 +16,18 @@ namespace seafire::routing typename ParameterType = server::string_parameter_t > class route_parameter_t + : public server::named_parameter_t { public: using parameter_type = ParameterType; using value_type = typename parameter_type::value_type; - static - std::string const& - name() - { - static std::string const name{Name}; - return name; - } - route_parameter_t(std::optional value) : _value{std::move(value)} {} + using server::named_parameter_t::name; + std::optional const& value() const {