Index: util/misc/move.h |
diff --git a/snapshot/test/test_memory_map_region_snapshot.cc b/util/misc/move.h |
similarity index 55% |
copy from snapshot/test/test_memory_map_region_snapshot.cc |
copy to util/misc/move.h |
index 53500c647624a19617dbf0609b3337eaf05f4e05..5cc28d175a9cf5b26b5a119b14a31ae6c4db3167 100644 |
--- a/snapshot/test/test_memory_map_region_snapshot.cc |
+++ b/util/misc/move.h |
@@ -12,26 +12,24 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#include "snapshot/test/test_memory_map_region_snapshot.h" |
+#ifndef CRASHPAD_UTIL_MISC_MOVE_H_ |
Mark Mentovai
2015/11/30 21:47:51
Ought to be in util/stdlib, where we put stdlibby
danakj
2015/11/30 22:07:01
Done.
|
+#define CRASHPAD_UTIL_MISC_MOVE_H_ |
namespace crashpad { |
-namespace test { |
-TestMemoryMapRegionSnapshot::TestMemoryMapRegionSnapshot() : memory_info_() { |
-} |
- |
-TestMemoryMapRegionSnapshot::~TestMemoryMapRegionSnapshot() { |
-} |
+// A replacement for std::remove_reference until C++11 library support is |
scottmg
2015/11/30 21:45:35
These need to be //! \brief, and indent the second
danakj
2015/11/30 22:07:01
Done.
|
+// available. |
+template <class T> |
+struct remove_reference { using type = T; }; |
+template <class T> |
+struct remove_reference<T&> { using type = T; }; |
-void TestMemoryMapRegionSnapshot::SetMindumpMemoryInfo( |
- const MINIDUMP_MEMORY_INFO& mmi) { |
- memory_info_ = mmi; |
+// A replacement for std::move() until C++11 library support is available. |
Mark Mentovai
2015/11/30 21:47:51
Does it work to define crashpad::move() and these
danakj
2015/11/30 22:07:01
Sure, we could do that. Idk that it's buying us an
|
+template<typename T> |
+typename remove_reference<T>::type&& move(T&& t) { |
+ return static_cast<typename remove_reference<T>::type&&>(t); |
} |
-const MINIDUMP_MEMORY_INFO& TestMemoryMapRegionSnapshot::AsMinidumpMemoryInfo() |
- const { |
- return memory_info_; |
-} |
- |
-} // namespace test |
} // namespace crashpad |
+ |
+#endif // CRASHPAD_UTIL_MISC_MOVE_H_ |