stlab 2.3.0
Modern, modular C++ algorithms, data structures, and concurrency primitives
Loading...
Searching...
No Matches
memory.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 Adobe
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5*/
6
7/**************************************************************************************************/
8
9#ifndef STLAB_MEMORY_HPP
10#define STLAB_MEMORY_HPP
11
15
16/**************************************************************************************************/
17
18#include <memory>
19#include <stlab/config.hpp>
20
21/**************************************************************************************************/
22
23namespace stlab {
24STLAB_VERSION_NAMESPACE_BEGIN()
25
26
30
31/**************************************************************************************************/
32
33
34template <typename T>
35auto make_weak_ptr(const std::shared_ptr<T>& x) {
36 return std::weak_ptr<T>(x);
37}
38
39/**************************************************************************************************/
40
42
43STLAB_VERSION_NAMESPACE_END()
44} // namespace stlab
45
46/**************************************************************************************************/
47
48#endif
auto make_weak_ptr(const std::shared_ptr< T > &x)
Returns a std::weak_ptr<T> sharing ownership with x.
Definition memory.hpp:35
Definition reverse.hpp:28