OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license | |
5 * that can be found in the LICENSE file in the root of the source | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 // This entire file is deprecated, and will be removed in XXXX 2016. Use | |
12 // std::unique_ptr instead! | |
13 | |
14 #ifndef WEBRTC_BASE_SCOPED_PTR_H__ | |
15 #define WEBRTC_BASE_SCOPED_PTR_H__ | |
16 | |
17 // All these #includes are left to maximize backwards compatibility. | |
18 | |
19 #include <assert.h> | |
20 #include <stddef.h> | |
21 #include <stdlib.h> | |
22 | |
23 #include <algorithm> | |
24 #include <cstddef> | |
25 #include <memory> | |
26 | |
27 #include "webrtc/base/constructormagic.h" | |
28 #include "webrtc/base/template_util.h" | |
29 #include "webrtc/typedefs.h" | |
30 | |
31 namespace rtc { | |
32 | |
33 template <typename T, typename Deleter = std::default_delete<T>> | |
34 using scoped_ptr = std::unique_ptr<T, Deleter>; | |
35 | |
36 // These used to convert between std::unique_ptr and std::unique_ptr. Now they | |
37 // are no-ops. | |
38 template <typename T> | |
39 std::unique_ptr<T> ScopedToUnique(std::unique_ptr<T> up) { | |
40 return up; | |
41 } | |
42 template <typename T> | |
43 std::unique_ptr<T> UniqueToScoped(std::unique_ptr<T> up) { | |
44 return up; | |
45 } | |
46 | |
47 } // namespace rtc | |
48 | |
49 #endif // #ifndef WEBRTC_BASE_SCOPED_PTR_H__ | |
OLD | NEW |