cleanup, merges
This commit is contained in:
parent
68e4f076e5
commit
a3e322b24f
@ -191,7 +191,7 @@ class GTEST_API_ FilePath {
|
||||
|
||||
void Normalize();
|
||||
|
||||
// Returns a pointer to the last ioccurrence of a valid path separator in
|
||||
// Returns a pointer to the last occurence of a valid path separator in
|
||||
// the FilePath. On Windows, for example, both '/' and '\' are valid path
|
||||
// separators. Returns NULL if no path separator was found.
|
||||
const char* FindLastPathSeparator() const;
|
||||
|
@ -803,31 +803,6 @@ struct RemoveConst<T[N]> {
|
||||
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
|
||||
GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
|
||||
|
||||
// Adds reference to a type if it is not a reference type,
|
||||
// otherwise leaves it unchanged. This is the same as
|
||||
// tr1::add_reference, which is not widely available yet.
|
||||
template <typename T>
|
||||
struct AddReference { typedef T& type; }; // NOLINT
|
||||
template <typename T>
|
||||
struct AddReference<T&> { typedef T& type; }; // NOLINT
|
||||
|
||||
// A handy wrapper around AddReference that works when the argument T
|
||||
// depends on template parameters.
|
||||
#define GTEST_ADD_REFERENCE_(T) \
|
||||
typename ::testing::internal::AddReference<T>::type
|
||||
|
||||
// Adds a reference to const on top of T as necessary. For example,
|
||||
// it transforms
|
||||
//
|
||||
// char ==> const char&
|
||||
// const char ==> const char&
|
||||
// char& ==> const char&
|
||||
// const char& ==> const char&
|
||||
//
|
||||
// The argument T must depend on some template parameters.
|
||||
#define GTEST_REFERENCE_TO_CONST_(T) \
|
||||
GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
|
||||
|
||||
// ImplicitlyConvertible<From, To>::value is a compile-time bool
|
||||
// constant that's true iff type From can be implicitly converted to
|
||||
// type To.
|
||||
|
@ -1366,6 +1366,39 @@ inline void FlushInfoLog() { fflush(NULL); }
|
||||
GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
|
||||
<< gtest_error
|
||||
|
||||
// Adds reference to a type if it is not a reference type,
|
||||
// otherwise leaves it unchanged. This is the same as
|
||||
// tr1::add_reference, which is not widely available yet.
|
||||
template <typename T>
|
||||
struct AddReference { typedef T& type; }; // NOLINT
|
||||
template <typename T>
|
||||
struct AddReference<T&> { typedef T& type; }; // NOLINT
|
||||
|
||||
// A handy wrapper around AddReference that works when the argument T
|
||||
// depends on template parameters.
|
||||
#define GTEST_ADD_REFERENCE_(T) \
|
||||
typename ::testing::internal::AddReference<T>::type
|
||||
|
||||
// Transforms "T" into "const T&" according to standard reference collapsing
|
||||
// rules (this is only needed as a backport for C++98 compilers that do not
|
||||
// support reference collapsing). Specifically, it transforms:
|
||||
//
|
||||
// char ==> const char&
|
||||
// const char ==> const char&
|
||||
// char& ==> char&
|
||||
// const char& ==> const char&
|
||||
//
|
||||
// Note that the non-const reference will not have "const" added. This is
|
||||
// standard, and necessary so that "T" can always bind to "const T&".
|
||||
template <typename T>
|
||||
struct ConstRef { typedef const T& type; };
|
||||
template <typename T>
|
||||
struct ConstRef<T&> { typedef T& type; };
|
||||
|
||||
// The argument T must depend on some template parameters.
|
||||
#define GTEST_REFERENCE_TO_CONST_(T) \
|
||||
typename ::testing::internal::ConstRef<T>::type
|
||||
|
||||
#if GTEST_HAS_STD_MOVE_
|
||||
using std::forward;
|
||||
using std::move;
|
||||
|
Loading…
Reference in New Issue
Block a user