Skip to content

Commit 2c6c539

Browse files
markchandlera-maurice
authored andcommitted
Firebase cpp: Added visual studio version check for move constructors as __cplusplus is not defined by default
PiperOrigin-RevId: 274675656
1 parent b60e0d5 commit 2c6c539

File tree

1 file changed

+4
-2
lines changed
  • app/src/include/firebase/internal

1 file changed

+4
-2
lines changed

app/src/include/firebase/internal/common.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
#include <utility>
2424

2525
// Move operators use rvalue references, which are a C++11 extension.
26+
// Also, Visual Studio 2010 and later actually support move operators despite
27+
// reporting __cplusplus to be 199711L, so explicitly check for that.
2628
// Also, stlport doesn't implement std::move().
27-
#if __cplusplus >= 201103L && !defined(_STLPORT_VERSION)
29+
#if (__cplusplus >= 201103L || _MSC_VER >= 1600) && !defined(_STLPORT_VERSION)
2830
#define FIREBASE_USE_MOVE_OPERATORS
29-
#endif // __cplusplus >= 201103L && !defined(_STLPORT_VERSION)
31+
#endif
3032

3133
// stlport doesn't implement std::function.
3234
#if !defined(_STLPORT_VERSION)

0 commit comments

Comments
 (0)