3#include <boost/thread/tss.hpp>
53template <
class =
void>
54boost::thread_specific_ptr<detail::LocalValues>&
67 template <
class... Args>
100 auto const iter = lvs->values.find(
this);
101 if (iter != lvs->values.end())
102 return *
reinterpret_cast<T*
>(iter->second->get());
105 return *
reinterpret_cast<T*
>(
T & operator*()
Stores instance of T specific to the calling coroutine or thread.
T * operator->()
Stores instance of T specific to the calling coroutine or thread.
LocalValue(Args &&... args)
boost::thread_specific_ptr< detail::LocalValues > & getLocalValues()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual ~BasicValue()=default
static void cleanup(LocalValues *lvs)
std::unordered_map< void const *, std::unique_ptr< BasicValue > > values