#define _GLIBCXX_TXN_SAFE
class out_of_range : public logic_error
{
public:
explicit out_of_range(const string& __arg)_GLIBCXX_TXN_SAFE;
};
_GLIBCXX_TXN_SAFE在这里是什么意思?
C ++标准委员会有一些小组研究并提出一些实验功能。其中之一是事务性内存研究小组(SG5)。他们的主要工作成果是C ++事务内存扩展的技术规范。您可以在事务存储中阅读一个简单的版本。
该提议的一部分是transaction_safe
功能说明符。因此,您的功能将是:
class out_of_range : public logic_error
{
public:
explicit out_of_range(const string& __arg) transaction_safe;
};
请注意,这transaction_safe
是一个关键字。
如果满足功能,则宏仅有条件地定义此说明符。例如从这里取:
// Conditionally enable annotations for the Transactional Memory TS on C++11.
// Most of the following conditions are due to limitations in the current
// implementation.
#if __cplusplus >= 201103L && _GLIBCXX_USE_CXX11_ABI \
&& _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201505L \
&& !_GLIBCXX_FULLY_DYNAMIC_STRING && __GXX_WEAK__ \
&& _GLIBCXX_USE_ALLOCATOR_NEW
#define _GLIBCXX_TXN_SAFE transaction_safe
#define _GLIBCXX_TXN_SAFE_DYN transaction_safe_dynamic
#else
#define _GLIBCXX_TXN_SAFE
#define _GLIBCXX_TXN_SAFE_DYN
#endif
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句