Skip to content

Commit

Permalink
UB fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
liuziangexit committed Apr 11, 2019
1 parent d2d496a commit 7246dc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,6 @@ ASALocalRun/
.mfractor/

#vscode
.vscode/
.vscode/
test/main.dll
test/main.o
4 changes: 2 additions & 2 deletions include/lazy.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class lazy {
// https://en.cppreference.com/w/cpp/utility/launder
// https://en.cppreference.com/w/cpp/feature_test
#ifdef __cpp_lib_launder
return std::launder(
*m_instance.load(std::memory_order::memory_order_relaxed));
return *std::launder(
m_instance.load(std::memory_order::memory_order_relaxed));
#else
return *m_instance.load(std::memory_order::memory_order_relaxed);
#endif
Expand Down

0 comments on commit 7246dc1

Please sign in to comment.