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 <rfriedma@redhat.com>
This commit is contained in:
Ronen Friedman 2024-11-13 03:02:00 -06:00
parent 29546089ee
commit a99fa1c51e
1 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,10 @@ public:
operator ValueT() const {
return value_cache.load();
}
ValueT operator*() const {
return value_cache.load();
}
};
#endif // CEPH_CONFIG_CACHER_H