Skip to content

Commit 0179a8e

Browse files
committed
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 <[email protected]>
1 parent f64ad44 commit 0179a8e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/versioned_variant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
namespace ceph {
2929

3030
// null encoding for std::monostate
31-
void encode(const std::monostate&, bufferlist& bl) {}
32-
void decode(std::monostate&, bufferlist::const_iterator& p) {}
31+
inline void encode(const std::monostate&, bufferlist& bl) {}
32+
inline void decode(std::monostate&, bufferlist::const_iterator& p) {}
3333

3434
// largest value that can be represented by `__u8 struct_v`
3535
inline constexpr size_t max_version = std::numeric_limits<__u8>::max();

0 commit comments

Comments
 (0)