Skip to content

Commit 87948f9

Browse files
committed
refactor(perf): remove comment format and fix C++03 move semantics fallback
1 parent e75fb44 commit 87948f9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Dependencies/Utility/Utility/CppMacros.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,17 @@
4949
#define nullptr 0
5050
#endif
5151

52-
// TheSuperHackers @performance bobtista 25/11/2025 Helper to move-assign from reference: uses std::move in C++11, swap in C++98
52+
// Helper to move-assign from reference: uses std::move in C++11, swap in C++98
5353
template<typename T>
5454
inline void move_or_swap(T& dest, T& src)
5555
{
5656
#if __cplusplus >= 201103L
5757
dest = std::move(src);
5858
#else
59-
// Use swap to emulate move semantics for VC6 compatibility
59+
// C++03 fallback: mimic move semantics
60+
// dest gets src's value, src becomes empty
61+
T empty;
6062
dest.swap(src);
63+
src.swap(empty);
6164
#endif
6265
}

0 commit comments

Comments
 (0)