File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -432,7 +432,11 @@ class MRDOCS_DECL
432
432
class MRDOCS_DECL
433
433
LazyObjectImpl : public ObjectImpl
434
434
{
435
+ #ifdef __cpp_lib_atomic_shared_ptr
435
436
std::atomic<std::shared_ptr<ObjectImpl>> mutable sp_;
437
+ #else
438
+ std::shared_ptr<ObjectImpl> mutable sp_;
439
+ #endif
436
440
437
441
using impl_type = Object::impl_type;
438
442
Original file line number Diff line number Diff line change @@ -217,6 +217,7 @@ ObjectImpl&
217
217
LazyObjectImpl::
218
218
obj () const
219
219
{
220
+ #ifdef __cpp_lib_atomic_shared_ptr
220
221
auto impl = sp_.load ();
221
222
if (impl)
222
223
return *impl;
@@ -225,6 +226,9 @@ obj() const
225
226
expected, construct ().impl ()))
226
227
return *sp_.load ();
227
228
return *expected;
229
+ #else
230
+ return *sp_;
231
+ #endif
228
232
}
229
233
230
234
std::size_t
You can’t perform that action at this time.
0 commit comments