Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
d3d142ef
Commit
d3d142ef
authored
Nov 17, 2014
by
kosak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ByMove() modifier for the Return() action.
parent
6aa0422e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
gtest-port.h
include/gtest/internal/gtest-port.h
+11
-8
No files found.
include/gtest/internal/gtest-port.h
View file @
d3d142ef
...
@@ -206,7 +206,7 @@
...
@@ -206,7 +206,7 @@
//
//
// C++11 feature wrappers:
// C++11 feature wrappers:
//
//
//
GTEST_MOVE_
- portability wrapper for std::move.
//
testing::internal::move
- portability wrapper for std::move.
//
//
// Synchronization:
// Synchronization:
// Mutex, MutexLock, ThreadLocal, GetThreadCount()
// Mutex, MutexLock, ThreadLocal, GetThreadCount()
...
@@ -905,12 +905,6 @@ using ::std::tuple_size;
...
@@ -905,12 +905,6 @@ using ::std::tuple_size;
# define GTEST_MUST_USE_RESULT_
# define GTEST_MUST_USE_RESULT_
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
#if GTEST_HAS_STD_MOVE_
# define GTEST_MOVE_(x) ::std::move(x) // NOLINT
#else
# define GTEST_MOVE_(x) x
#endif
// MS C++ compiler emits warning when a conditional expression is compile time
// MS C++ compiler emits warning when a conditional expression is compile time
// constant. In some contexts this warning is false positive and needs to be
// constant. In some contexts this warning is false positive and needs to be
// suppressed. Use the following two macros in such cases:
// suppressed. Use the following two macros in such cases:
...
@@ -1323,6 +1317,15 @@ inline void FlushInfoLog() { fflush(NULL); }
...
@@ -1323,6 +1317,15 @@ inline void FlushInfoLog() { fflush(NULL); }
GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
<< gtest_error
<< gtest_error
#if GTEST_HAS_STD_MOVE_
using
std
::
move
;
#else // GTEST_LANG_CXX11
template
<
typename
T
>
const
T
&
move
(
const
T
&
t
)
{
return
t
;
}
#endif // GTEST_HAS_STD_MOVE_
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
//
// Use ImplicitCast_ as a safe version of static_cast for upcasting in
// Use ImplicitCast_ as a safe version of static_cast for upcasting in
...
@@ -1344,7 +1347,7 @@ inline void FlushInfoLog() { fflush(NULL); }
...
@@ -1344,7 +1347,7 @@ inline void FlushInfoLog() { fflush(NULL); }
// similar functions users may have (e.g., implicit_cast). The internal
// similar functions users may have (e.g., implicit_cast). The internal
// namespace alone is not enough because the function can be found by ADL.
// namespace alone is not enough because the function can be found by ADL.
template
<
typename
To
>
template
<
typename
To
>
inline
To
ImplicitCast_
(
To
x
)
{
return
x
;
}
inline
To
ImplicitCast_
(
To
x
)
{
return
move
(
x
)
;
}
// When you upcast (that is, cast a pointer from type Foo to type
// When you upcast (that is, cast a pointer from type Foo to type
// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment