Skip to content

Commit a99fa1c

Browse files
committed
common: a simple API to extract md_config_cacher_t cached value
Using a type-deduced operator() (i.e. my_opt() ), instead of the existing ValueT() operator (which requires a type-matching cast). Signed-off-by: Ronen Friedman <[email protected]>
1 parent 2954608 commit a99fa1c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/common/config_cacher.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ class md_config_cacher_t : public md_config_obs_t {
5353
operator ValueT() const {
5454
return value_cache.load();
5555
}
56+
57+
ValueT operator*() const {
58+
return value_cache.load();
59+
}
5660
};
5761

5862
#endif // CEPH_CONFIG_CACHER_H

0 commit comments

Comments
 (0)