Skip to content

Commit

Permalink
Merge pull request #5145 from tchaikov/v/rpc/concepts
Browse files Browse the repository at this point in the history
v/rpc: use std::constructible_from when appropriate
  • Loading branch information
mmaslankaprv committed Jun 27, 2022
2 parents 9dc0848 + 40927e4 commit f2401e4
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 f2401e4

Please sign in to comment.