2 Copyright 2017 Glen Joseph Fernandes (glenjofe@gmail.com)
4 Distributed under the Boost Software License, Version 1.0.
6 See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt
11 # make_local_shared: Creating local_shared_ptr
14 :idprefix: make_local_shared_
18 The function templates `make_local_shared` and `allocate_local_shared` provide
19 convenient, safe and efficient ways to create `local_shared_ptr` objects. They
20 are analogous to `make_shared` and `allocate_shared` for `shared_ptr`.
24 `make_local_shared` and `allocate_local_shared` are defined in
25 `<boost/smart_ptr/make_local_shared.hpp>`.
30 `// T is not an array`
31 template<class T, class... Args>
32 local_shared_ptr<T> make_local_shared(Args&&... args);
33 template<class T, class A, class... Args>
34 local_shared_ptr<T> allocate_local_shared(const A& a, Args&&... args);
36 `// T is an array of unknown bounds`
38 local_shared_ptr<T> make_local_shared(std::size_t n);
39 template<class T, class A>
40 local_shared_ptr<T> allocate_local_shared(const A& a, std::size_t n);
42 `// T is an array of known bounds`
44 local_shared_ptr<T> make_local_shared();
45 template<class T, class A>
46 local_shared_ptr<T> allocate_local_shared(const A& a);
48 `// T is an array of unknown bounds`
50 local_shared_ptr<T> make_local_shared(std::size_t n,
51 const remove_extent_t<T>& v);
52 template<class T, class A>
53 local_shared_ptr<T> allocate_local_shared(const A& a, std::size_t n,
54 const remove_extent_t<T>& v);
56 `// T is an array of known bounds`
58 local_shared_ptr<T> make_local_shared(const remove_extent_t<T>& v);
59 template<class T, class A>
60 local_shared_ptr<T> allocate_local_shared(const A& a,
61 const remove_extent_t<T>& v);
63 `// T is not an array of known bounds`
65 local_shared_ptr<T> make_local_shared_noinit();
66 template<class T, class A>
67 local_shared_ptr<T> allocate_local_shared_noinit(const A& a);
69 `// T is an array of unknown bounds`
71 local_shared_ptr<T> make_local_shared_noinit(std::size_t n);
72 template<class T, class A>
73 local_shared_ptr<T> allocate_local_shared_noinit(const A& a,
80 The requirements and effects of these functions are the same as `make_shared`
81 and `allocate_shared`, except that a `local_shared_ptr` is returned.