From cfd4152291a6c32e3385fbcbe8100e0f3874d723 Mon Sep 17 00:00:00 2001
From: Glen Fernandes
Free Functions
Example
- History
+ History
Originally the Boost function templates make_shared
and
allocate_shared
were for efficient allocation of single
@@ -53,26 +53,26 @@
template<typename T, typename... Args>
shared_ptr<T[]> make_shared(initializer_list<T> list);
- template<typename T, typename... Args>
- shared_ptr<T[][N]> make_shared(size_t size, initializer_list<T> list);
-
template<typename T, typename A, typename... Args>
shared_ptr<T[]> allocate_shared(const A& allocator, initializer_list<T> list);
-
- template<typename T, typename A, typename... Args>
- shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, initializer_list<T> list);
#endif
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
template<typename T, typename... Args>
shared_ptr<T[N]> make_shared(const T (&list)[N]);
+ template<typename T, typename... Args>
+ shared_ptr<T[][N]> make_shared(size_t size, const T (&list)[N]);
+
template<typename T, typename... Args>
shared_ptr<T[M][N]> make_shared(const T (&list)[N]);
template<typename T, typename A, typename... Args>
shared_ptr<T[N]> allocate_shared(const A& allocator, const T (&list)[N]);
+ template<typename T, typename A, typename... Args>
+ shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, const T (&list)[N]);
+
template<typename T, typename A, typename... Args>
shared_ptr<T[M][N]> allocate_shared(const A& allocator, const T (&list)[N]);
#endif
@@ -151,9 +151,9 @@ template<typename T, typename A, typename... Args>
fixed size array.
template<typename T, typename... Args> - shared_ptr<T[][N]> make_shared(size_t size, initializer_list<T> list); + shared_ptr<T[][N]> make_shared(size_t size, const T (&list)[N]); template<typename T, typename A, typename... Args> - shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, initializer_list<T> list);+ shared_ptr<T[][N]> allocate_shared(const A& allocator, size_t size, const T (&list)[N]);
Description: These overloads initialize inner array elements from the initializer list.