Skip to content

Commit 7809599

Browse files
committed
C++17 copy elision ifdefs
1 parent 3919b25 commit 7809599

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

include/boost/leaf/context.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,13 @@ class context
292292
if( ctx_ )
293293
ctx_->activate();
294294
}
295+
#if __cplusplus < 201703L
295296
BOOST_LEAF_CONSTEXPR BOOST_LEAF_ALWAYS_INLINE raii_deactivator( raii_deactivator && x ) noexcept:
296297
ctx_(x.ctx_)
297298
{
298299
x.ctx_ = nullptr;
299300
}
301+
#endif
300302
BOOST_LEAF_ALWAYS_INLINE ~raii_deactivator() noexcept
301303
{
302304
if( ctx_ && ctx_->is_active() )

include/boost/leaf/on_error.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ namespace detail
166166
template <class... Item>
167167
class preloaded
168168
{
169-
preloaded & operator=( preloaded const & ) = delete;
170-
#if __cplusplus >= 201703L
171169
preloaded( preloaded const & ) = delete;
172-
#else
173-
bool moved_ = false;
174-
#endif
170+
preloaded & operator=( preloaded const & ) = delete;
171+
175172
std::tuple<Item...> p_;
176173
error_monitor id_;
174+
#if __cplusplus < 201703L
175+
bool moved_ = false;
176+
#endif
177177

178178
public:
179179

0 commit comments

Comments
 (0)