common: use inline for monostate dencoders

fix a 'multiple definition' error when included by multiple sources:

src/common/versioned_variant.h:31: multiple definition of `ceph::encode(std::monostate const&, ceph::buffer::v15_2_0::list&)';
rgw_main.cc.o:src/common/versioned_variant.h:31: first defined here

Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2023-12-05 12:21:18 -05:00
parent f64ad4406c
commit 0179a8ea2f

View File

@ -28,8 +28,8 @@
namespace ceph {
// null encoding for std::monostate
void encode(const std::monostate&, bufferlist& bl) {}
void decode(std::monostate&, bufferlist::const_iterator& p) {}
inline void encode(const std::monostate&, bufferlist& bl) {}
inline void decode(std::monostate&, bufferlist::const_iterator& p) {}
// largest value that can be represented by `__u8 struct_v`
inline constexpr size_t max_version = std::numeric_limits<__u8>::max();