Skip to content

Commit

Permalink
v/rpc: use std::constructible_from when appropriate
Browse files Browse the repository at this point in the history
for better readability

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
  • Loading branch information
tchaikov committed Jun 16, 2022
1 parent e52ce8d commit 40927e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/v/rpc/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <absl/container/flat_hash_map.h>
#include <bits/stdint-uintn.h>

#include <concepts>
#include <cstdint>
#include <memory>
#include <optional>
Expand Down Expand Up @@ -210,9 +211,7 @@ transport::send_typed_versioned(
}

template<typename Protocol>
concept RpcClientProtocol = requires(rpc::transport& t) {
{ Protocol(t) } -> std::same_as<Protocol>;
};
concept RpcClientProtocol = std::constructible_from<Protocol, rpc::transport&>;

template<typename... Protocol>
requires(RpcClientProtocol<Protocol>&&...) class client : public Protocol... {
Expand Down

0 comments on commit 40927e4

Please sign in to comment.