Skip to content

Commit 39247fb

Browse files
committed
Fixed MSVC related compilation issues
1 parent 25260ed commit 39247fb

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

example/terminate_handler.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ BOOST_NOINLINE void foo(int i) {
2121
bar(--i);
2222
}
2323

24-
#if defined(BOOST_GCC) && defined(BOOST_WINDOWS)
25-
26-
// MinGW workaround
24+
// MinGW and MSVC workarounds
2725
#include <cstdlib> // ::_Exit
2826
namespace std { using ::_Exit; }
2927

30-
#endif
31-
3228
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3329

3430
//[getting_started_terminate_handlers

include/boost/stacktrace/stacktrace.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,23 @@ class basic_stacktrace {
176176
~basic_stacktrace() BOOST_NOEXCEPT = default;
177177
#endif
178178

179-
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
179+
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
180180
/// @b Complexity: O(1)
181181
///
182182
/// @b Async-Handler-Safety: Safe if Allocator construction and copying are async signal safe.
183-
basic_stacktrace(basic_stacktrace&& st) = default;
183+
basic_stacktrace(basic_stacktrace&& st) BOOST_NOEXCEPT
184+
: impl_(std::move(st.impl_))
185+
{}
184186

185187
/// @b Complexity: O(st.size())
186188
///
187189
/// @b Async-Handler-Safety: Safe if Allocator construction and copying are async signal safe.
188-
basic_stacktrace& operator=(basic_stacktrace&& st) = default;
190+
basic_stacktrace& operator=(basic_stacktrace&& st)
191+
BOOST_NOEXCEPT_IF(( std::is_nothrow_move_assignable< std::vector<boost::stacktrace::frame, Allocator> >::value ))
192+
{
193+
impl_ = std::move(st.impl_);
194+
return *this;
195+
}
189196
#endif
190197

191198
/// @returns Number of function names stored inside the class.

0 commit comments

Comments
 (0)