From 5356253cf09d60a539042b3210c2d3602fda7e0e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 17 Nov 2021 03:41:36 +0100 Subject: ordered_atomic: Add to_string(const ordered_atomic<>&), allowing to skip manual '.load()' using jau::to_string() etc. --- include/jau/ordered_atomic.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/jau') diff --git a/include/jau/ordered_atomic.hpp b/include/jau/ordered_atomic.hpp index 8b855be..0193cc3 100644 --- a/include/jau/ordered_atomic.hpp +++ b/include/jau/ordered_atomic.hpp @@ -209,6 +209,12 @@ template struct ordered_atomic : private s }; + template + std::string to_string(const ordered_atomic<_Tp, _MO> & ref) + { + return to_string(ref.load()); + } + /** SC atomic integral scalar boolean. Memory-Model (MM) guaranteed sequential consistency (SC) between acquire (read) and release (write) */ typedef ordered_atomic sc_atomic_bool; -- cgit v1.2.3