Skip to content

Commit

Permalink
Fix: add std::forward<StrT> to set_... setters
Browse files Browse the repository at this point in the history
  • Loading branch information
rmisev committed Nov 4, 2023
1 parent 46754b1 commit 28ee85f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/upa/url.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class url {
bool href(StrT&& str);
/// Equivalent to @link href(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_href(StrT&& str) { return href(str); }
bool set_href(StrT&& str) { return href(std::forward<StrT>(str)); }

/// @brief The protocol setter
///
Expand All @@ -256,7 +256,7 @@ class url {
bool protocol(StrT&& str);
/// Equivalent to @link protocol(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_protocol(StrT&& str) { return protocol(str); }
bool set_protocol(StrT&& str) { return protocol(std::forward<StrT>(str)); }

/// @brief The username setter
///
Expand All @@ -269,7 +269,7 @@ class url {
bool username(StrT&& str);
/// Equivalent to @link username(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_username(StrT&& str) { return username(str); }
bool set_username(StrT&& str) { return username(std::forward<StrT>(str)); }

/// @brief The password setter
///
Expand All @@ -282,7 +282,7 @@ class url {
bool password(StrT&& str);
/// Equivalent to @link password(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_password(StrT&& str) { return password(str); }
bool set_password(StrT&& str) { return password(std::forward<StrT>(str)); }

/// @brief The host setter
///
Expand All @@ -295,7 +295,7 @@ class url {
bool host(StrT&& str);
/// Equivalent to @link host(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_host(StrT&& str) { return host(str); }
bool set_host(StrT&& str) { return host(std::forward<StrT>(str)); }

/// @brief The hostname setter
///
Expand All @@ -308,7 +308,7 @@ class url {
bool hostname(StrT&& str);
/// Equivalent to @link hostname(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_hostname(StrT&& str) { return hostname(str); }
bool set_hostname(StrT&& str) { return hostname(std::forward<StrT>(str)); }

/// @brief The port setter
///
Expand All @@ -321,7 +321,7 @@ class url {
bool port(StrT&& str);
/// Equivalent to @link port(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_port(StrT&& str) { return port(str); }
bool set_port(StrT&& str) { return port(std::forward<StrT>(str)); }

/// @brief The pathname setter
///
Expand All @@ -334,7 +334,7 @@ class url {
bool pathname(StrT&& str);
/// Equivalent to @link pathname(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_pathname(StrT&& str) { return pathname(str); }
bool set_pathname(StrT&& str) { return pathname(std::forward<StrT>(str)); }

/// @brief The search setter
///
Expand All @@ -347,7 +347,7 @@ class url {
bool search(StrT&& str);
/// Equivalent to @link search(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_search(StrT&& str) { return search(str); }
bool set_search(StrT&& str) { return search(std::forward<StrT>(str)); }

/// @brief The hash setter
///
Expand All @@ -360,7 +360,7 @@ class url {
bool hash(StrT&& str);
/// Equivalent to @link hash(StrT&& str) @endlink
template <class StrT, enable_if_str_arg_t<StrT> = 0>
bool set_hash(StrT&& str) { return hash(str); }
bool set_hash(StrT&& str) { return hash(std::forward<StrT>(str)); }

// Getters

Expand Down

0 comments on commit 28ee85f

Please sign in to comment.