BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslma_sharedptrinplacerep_cpp03.h
Go to the documentation of this file.
1/// @file bslma_sharedptrinplacerep_cpp03.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslma_sharedptrinplacerep_cpp03.h -*-C++-*-
8
9// Automatically generated file. **DO NOT EDIT**
10
11#ifndef INCLUDED_BSLMA_SHAREDPTRINPLACEREP_CPP03
12#define INCLUDED_BSLMA_SHAREDPTRINPLACEREP_CPP03
13
14/// @defgroup bslma_sharedptrinplacerep_cpp03 bslma_sharedptrinplacerep_cpp03
15/// @brief Provide C++03 implementation for bslma_sharedptrinplacerep.h
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslma
19/// @{
20/// @addtogroup bslma_sharedptrinplacerep_cpp03
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslma_sharedptrinplacerep_cpp03-purpose"> Purpose</a>
25/// * <a href="#bslma_sharedptrinplacerep_cpp03-classes"> Classes </a>
26/// * <a href="#bslma_sharedptrinplacerep_cpp03-description"> Description </a>
27///
28/// # Purpose {#bslma_sharedptrinplacerep_cpp03-purpose}
29/// Provide C++03 implementation for bslma_sharedptrinplacerep.h
30///
31/// # Classes {#bslma_sharedptrinplacerep_cpp03-classes}
32/// See bslma_sharedptrinplacerep.h for list of classes
33///
34/// @see bslma_sharedptrinplacerep
35///
36/// # Description {#bslma_sharedptrinplacerep_cpp03-description}
37/// This component is the C++03 translation of a C++11 component,
38/// generated by the 'sim_cpp11_features.pl' program. If the original header
39/// contains any specially delimited regions of C++11 code, then this generated
40/// file contains the C++03 equivalent, i.e., with variadic templates expanded
41/// and rvalue-references replaced by 'bslmf::MovableRef' objects. The header
42/// code in this file is designed to be '#include'd into the original header
43/// when compiling with a C++03 compiler. If there are no specially delimited
44/// regions of C++11 code, then this header contains no code and is not
45/// '#include'd in the original header.
46///
47/// Generated on Sun Sep 1 05:38:38 2024
48/// Command line: sim_cpp11_features.pl bslma_sharedptrinplacerep.h
49/// @}
50/** @} */
51/** @} */
52
53/** @addtogroup bsl
54 * @{
55 */
56/** @addtogroup bslma
57 * @{
58 */
59/** @addtogroup bslma_sharedptrinplacerep_cpp03
60 * @{
61 */
62
63#ifdef COMPILING_BSLMA_SHAREDPTRINPLACEREP_H
64
65
66namespace bslma {
67
68 // =========================
69 // class SharedPtrInplaceRep
70 // =========================
71
72/// This class provides a concrete implementation of the `SharedPtrRep`
73/// protocol for "in-place" instances of the parameterized `TYPE`. Upon
74/// destruction of this object, the destructor of `TYPE` is invoked.
75///
76/// See @ref bslma_sharedptrinplacerep_cpp03
77template <class TYPE>
78class SharedPtrInplaceRep : public SharedPtrRep {
79
80 // DATA
81 Allocator *d_allocator_p; // memory allocator (held, not owned)
82
83 TYPE d_instance; // Beginning of the in-place buffer. Note that
84 // this must be last in this layout to allow for
85 // the possibility of creating in-place
86 // uninitialized buffer, where it is possible to
87 // access memory beyond the 'd_instance'
88 // footprint (refer to 'bsl::shared_ptr::
89 // createInplaceUninitializedBuffer' for sample
90 // usage)
91
92 private:
93 // NOT IMPLEMENTED
94 SharedPtrInplaceRep(const SharedPtrInplaceRep&);
95 SharedPtrInplaceRep& operator=(const SharedPtrInplaceRep&);
96
97 // PRIVATE CREATORS
98
99 /// Destroy this representation object and the embedded instance of
100 /// parameterized `TYPE`. Note that this destructor is never called.
101 /// Instead, `disposeObject` destroys the in-place object and
102 /// `disposeRep` deallocates this representation object (including the
103 /// shared object's footprint).
104 ~SharedPtrInplaceRep() BSLS_KEYWORD_OVERRIDE;
105
106 public:
107 // CREATORS
108#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
109// {{{ BEGIN GENERATED CODE
110// Command line: sim_cpp11_features.pl bslma_sharedptrinplacerep.h
111#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
112#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT 14
113#endif
114#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A
115#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
116#endif
117
118#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 0
119 explicit SharedPtrInplaceRep(Allocator *basicAllocator);
120#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 0
121
122#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 1
123 template <class ARGS_01>
124 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
125 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
126#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 1
127
128#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 2
129 template <class ARGS_01,
130 class ARGS_02>
131 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
132 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
133 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
134#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 2
135
136#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 3
137 template <class ARGS_01,
138 class ARGS_02,
139 class ARGS_03>
140 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
141 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
142 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
143 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
144#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 3
145
146#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 4
147 template <class ARGS_01,
148 class ARGS_02,
149 class ARGS_03,
150 class ARGS_04>
151 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
152 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
153 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
154 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
155 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
156#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 4
157
158#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 5
159 template <class ARGS_01,
160 class ARGS_02,
161 class ARGS_03,
162 class ARGS_04,
163 class ARGS_05>
164 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
165 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
166 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
167 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
168 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
169 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
170#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 5
171
172#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 6
173 template <class ARGS_01,
174 class ARGS_02,
175 class ARGS_03,
176 class ARGS_04,
177 class ARGS_05,
178 class ARGS_06>
179 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
180 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
181 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
182 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
183 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
184 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
185 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
186#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 6
187
188#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 7
189 template <class ARGS_01,
190 class ARGS_02,
191 class ARGS_03,
192 class ARGS_04,
193 class ARGS_05,
194 class ARGS_06,
195 class ARGS_07>
196 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
197 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
198 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
199 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
200 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
201 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
202 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
203 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
204#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 7
205
206#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 8
207 template <class ARGS_01,
208 class ARGS_02,
209 class ARGS_03,
210 class ARGS_04,
211 class ARGS_05,
212 class ARGS_06,
213 class ARGS_07,
214 class ARGS_08>
215 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
216 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
217 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
218 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
219 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
220 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
221 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
222 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
223 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
224#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 8
225
226#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 9
227 template <class ARGS_01,
228 class ARGS_02,
229 class ARGS_03,
230 class ARGS_04,
231 class ARGS_05,
232 class ARGS_06,
233 class ARGS_07,
234 class ARGS_08,
235 class ARGS_09>
236 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
237 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
238 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
239 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
240 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
241 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
242 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
243 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
244 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
245 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
246#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 9
247
248#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 10
249 template <class ARGS_01,
250 class ARGS_02,
251 class ARGS_03,
252 class ARGS_04,
253 class ARGS_05,
254 class ARGS_06,
255 class ARGS_07,
256 class ARGS_08,
257 class ARGS_09,
258 class ARGS_10>
259 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
260 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
261 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
262 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
263 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
264 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
265 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
266 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
267 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
268 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
269 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
270#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 10
271
272#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 11
273 template <class ARGS_01,
274 class ARGS_02,
275 class ARGS_03,
276 class ARGS_04,
277 class ARGS_05,
278 class ARGS_06,
279 class ARGS_07,
280 class ARGS_08,
281 class ARGS_09,
282 class ARGS_10,
283 class ARGS_11>
284 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
285 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
286 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
287 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
288 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
289 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
290 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
291 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
292 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
293 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
294 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
295 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11);
296#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 11
297
298#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 12
299 template <class ARGS_01,
300 class ARGS_02,
301 class ARGS_03,
302 class ARGS_04,
303 class ARGS_05,
304 class ARGS_06,
305 class ARGS_07,
306 class ARGS_08,
307 class ARGS_09,
308 class ARGS_10,
309 class ARGS_11,
310 class ARGS_12>
311 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
312 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
313 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
314 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
315 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
316 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
317 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
318 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
319 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
320 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
321 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
322 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11,
323 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_12) args_12);
324#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 12
325
326#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 13
327 template <class ARGS_01,
328 class ARGS_02,
329 class ARGS_03,
330 class ARGS_04,
331 class ARGS_05,
332 class ARGS_06,
333 class ARGS_07,
334 class ARGS_08,
335 class ARGS_09,
336 class ARGS_10,
337 class ARGS_11,
338 class ARGS_12,
339 class ARGS_13>
340 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
341 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
342 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
343 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
344 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
345 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
346 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
347 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
348 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
349 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
350 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
351 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11,
352 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_12) args_12,
353 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_13) args_13);
354#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 13
355
356#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 14
357 template <class ARGS_01,
358 class ARGS_02,
359 class ARGS_03,
360 class ARGS_04,
361 class ARGS_05,
362 class ARGS_06,
363 class ARGS_07,
364 class ARGS_08,
365 class ARGS_09,
366 class ARGS_10,
367 class ARGS_11,
368 class ARGS_12,
369 class ARGS_13,
370 class ARGS_14>
371 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
372 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
373 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
374 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
375 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
376 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
377 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
378 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
379 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
380 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
381 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
382 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11,
383 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_12) args_12,
384 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_13) args_13,
385 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_14) args_14);
386#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_A >= 14
387
388#else
389// The generated code below is a workaround for the absence of perfect
390// forwarding in some compilers.
391
392 template <class... ARGS>
393 explicit SharedPtrInplaceRep(Allocator *basicAllocator,
395// }}} END GENERATED CODE
396#endif
397
398 // MANIPULATORS
399
400 /// Destroy the object being referred to by this representation. This
401 /// method is automatically invoked by `releaseRef` when the number of
402 /// shared references reaches zero and should not be explicitly invoked
403 /// otherwise. Note that this function calls the destructor for the
404 /// shared object, but does not deallocate its footprint.
406
407 /// Deallocate the memory associated with this representation object
408 /// (including the shared object's footprint). This method is
409 /// automatically invoked by `releaseRef` and `releaseWeakRef` when the
410 /// number of weak references and the number of shared references both
411 /// reach zero and should not be explicitly invoked otherwise. The
412 /// behavior is undefined unless `disposeObject` has already been called
413 /// for this representation. Note that this `disposeRep` method
414 /// effectively serves as the representation object's destructor.
416
417 /// Return a null pointer. Note that the specified `type` is not used
418 /// as an in-place representation for a shared pointer can never store a
419 /// user-supplied deleter (there is no function that might try to create
420 /// one).
421 void *getDeleter(const std::type_info& type) BSLS_KEYWORD_OVERRIDE;
422
423 /// Return the address of the modifiable (in-place) object referred to
424 /// by this representation object.
425 TYPE *ptr();
426
427 // ACCESSORS
428
429 /// Return the (untyped) address of the modifiable (in-place) object
430 /// referred to by this representation object.
432};
433
434 //============================
435 // SharedPtrInplaceRep_ImpUtil
436 //============================
437
438/// This struct provides a namespace for several static methods that ease
439/// the implementation of many methods of the `SharedPtrInplaceRep` class.
440struct SharedPtrInplaceRep_ImpUtil {
441
442 // CLASS METHODS
443
444 /// Return the specified `reference`. Note that this pair of overloaded
445 /// functions is necessary to correctly forward movable references when
446 /// providing explicit move-semantics for C++03; otherwise the
447 /// `MovableRef` is likely to be wrapped in multiple layers of reference
448 /// wrappers, and not be recognized as the movable vocabulary type.
449 template <class TYPE>
450 static const TYPE& forward(const TYPE& reference);
451 template <class TYPE>
452 static BloombergLP::bslmf::MovableRef<TYPE> forward(
453 const BloombergLP::bslmf::MovableRef<TYPE>& reference);
454
455 /// Return the specified `address` cast as a pointer to `void`, even if
456 /// (the template parameter) `TYPE` is cv-qualified.
457 template <class TYPE>
458 static void *voidify(TYPE *address);
459
460 /// Destroy the specified `object`.
461 template <class TYPE>
462 static void dispose(const TYPE& object);
463
464 /// Destroy each element of the specified `object`.
465 template <class TYPE, size_t SIZE>
466 static void dispose(const TYPE (&object)[SIZE]);
467};
468
469// ============================================================================
470// INLINE DEFINITIONS
471// ============================================================================
472
473
474 // ---------------------------
475 // SharedPtrInplaceRep_ImpUtil
476 // ---------------------------
477
478template <class TYPE>
479inline
480const TYPE& SharedPtrInplaceRep_ImpUtil::forward(const TYPE& reference)
481{
482 return reference;
483}
484
485template <class TYPE>
486inline
487BloombergLP::bslmf::MovableRef<TYPE> SharedPtrInplaceRep_ImpUtil::forward(
488 const BloombergLP::bslmf::MovableRef<TYPE>& reference)
489{
490 return reference;
491}
492
493template <class TYPE>
494inline
495void *SharedPtrInplaceRep_ImpUtil::voidify(TYPE *address) {
496 return static_cast<void *>(
497 const_cast<typename bsl::remove_cv<TYPE>::type *>(address));
498}
499
500template <class TYPE>
501inline
502void SharedPtrInplaceRep_ImpUtil::dispose(const TYPE& object)
503{
504 object.~TYPE();
505}
506
507template <class TYPE, size_t SIZE>
508inline
509void SharedPtrInplaceRep_ImpUtil::dispose(const TYPE (&object)[SIZE])
510{
511 for (size_t i = 0; i < SIZE; ++i) {
512 dispose(object[i]);
513 }
514}
515
516 // -------------------------
517 // class SharedPtrInplaceRep
518 // -------------------------
519
520// CREATORS
521#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
522// {{{ BEGIN GENERATED CODE
523// Command line: sim_cpp11_features.pl bslma_sharedptrinplacerep.h
524#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
525#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT 14
526#endif
527#ifndef BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B
528#define BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT
529#endif
530#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 0
531template <class TYPE>
532SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator)
533: d_allocator_p(basicAllocator)
534, d_instance()
535{
536}
537#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 0
538
539#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 1
540template <class TYPE>
541template <class ARGS_01>
542SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
543 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
544: d_allocator_p(basicAllocator)
545, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01))
546{
547}
548#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 1
549
550#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 2
551template <class TYPE>
552template <class ARGS_01,
553 class ARGS_02>
554SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
555 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
556 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
557: d_allocator_p(basicAllocator)
558, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
559 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02))
560{
561}
562#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 2
563
564#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 3
565template <class TYPE>
566template <class ARGS_01,
567 class ARGS_02,
568 class ARGS_03>
569SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
570 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
571 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
572 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
573: d_allocator_p(basicAllocator)
574, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
575 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
576 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03))
577{
578}
579#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 3
580
581#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 4
582template <class TYPE>
583template <class ARGS_01,
584 class ARGS_02,
585 class ARGS_03,
586 class ARGS_04>
587SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
588 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
589 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
590 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
591 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
592: d_allocator_p(basicAllocator)
593, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
594 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
595 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
596 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04))
597{
598}
599#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 4
600
601#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 5
602template <class TYPE>
603template <class ARGS_01,
604 class ARGS_02,
605 class ARGS_03,
606 class ARGS_04,
607 class ARGS_05>
608SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
609 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
610 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
611 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
612 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
613 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
614: d_allocator_p(basicAllocator)
615, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
616 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
617 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
618 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
619 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05))
620{
621}
622#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 5
623
624#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 6
625template <class TYPE>
626template <class ARGS_01,
627 class ARGS_02,
628 class ARGS_03,
629 class ARGS_04,
630 class ARGS_05,
631 class ARGS_06>
632SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
633 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
634 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
635 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
636 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
637 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
638 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
639: d_allocator_p(basicAllocator)
640, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
641 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
642 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
643 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
644 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
645 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06))
646{
647}
648#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 6
649
650#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 7
651template <class TYPE>
652template <class ARGS_01,
653 class ARGS_02,
654 class ARGS_03,
655 class ARGS_04,
656 class ARGS_05,
657 class ARGS_06,
658 class ARGS_07>
659SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
660 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
661 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
662 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
663 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
664 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
665 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
666 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
667: d_allocator_p(basicAllocator)
668, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
669 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
670 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
671 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
672 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
673 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
674 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07))
675{
676}
677#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 7
678
679#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 8
680template <class TYPE>
681template <class ARGS_01,
682 class ARGS_02,
683 class ARGS_03,
684 class ARGS_04,
685 class ARGS_05,
686 class ARGS_06,
687 class ARGS_07,
688 class ARGS_08>
689SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
690 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
691 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
692 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
693 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
694 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
695 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
696 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
697 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
698: d_allocator_p(basicAllocator)
699, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
700 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
701 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
702 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
703 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
704 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
705 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07),
706 BSLS_COMPILERFEATURES_FORWARD(ARGS_08,args_08))
707{
708}
709#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 8
710
711#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 9
712template <class TYPE>
713template <class ARGS_01,
714 class ARGS_02,
715 class ARGS_03,
716 class ARGS_04,
717 class ARGS_05,
718 class ARGS_06,
719 class ARGS_07,
720 class ARGS_08,
721 class ARGS_09>
722SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
723 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
724 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
725 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
726 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
727 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
728 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
729 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
730 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
731 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
732: d_allocator_p(basicAllocator)
733, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
734 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
735 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
736 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
737 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
738 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
739 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07),
740 BSLS_COMPILERFEATURES_FORWARD(ARGS_08,args_08),
741 BSLS_COMPILERFEATURES_FORWARD(ARGS_09,args_09))
742{
743}
744#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 9
745
746#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 10
747template <class TYPE>
748template <class ARGS_01,
749 class ARGS_02,
750 class ARGS_03,
751 class ARGS_04,
752 class ARGS_05,
753 class ARGS_06,
754 class ARGS_07,
755 class ARGS_08,
756 class ARGS_09,
757 class ARGS_10>
758SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
759 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
760 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
761 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
762 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
763 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
764 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
765 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
766 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
767 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
768 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
769: d_allocator_p(basicAllocator)
770, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
771 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
772 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
773 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
774 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
775 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
776 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07),
777 BSLS_COMPILERFEATURES_FORWARD(ARGS_08,args_08),
778 BSLS_COMPILERFEATURES_FORWARD(ARGS_09,args_09),
779 BSLS_COMPILERFEATURES_FORWARD(ARGS_10,args_10))
780{
781}
782#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 10
783
784#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 11
785template <class TYPE>
786template <class ARGS_01,
787 class ARGS_02,
788 class ARGS_03,
789 class ARGS_04,
790 class ARGS_05,
791 class ARGS_06,
792 class ARGS_07,
793 class ARGS_08,
794 class ARGS_09,
795 class ARGS_10,
796 class ARGS_11>
797SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
798 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
799 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
800 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
801 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
802 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
803 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
804 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
805 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
806 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
807 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
808 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11)
809: d_allocator_p(basicAllocator)
810, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
811 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
812 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
813 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
814 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
815 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
816 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07),
817 BSLS_COMPILERFEATURES_FORWARD(ARGS_08,args_08),
818 BSLS_COMPILERFEATURES_FORWARD(ARGS_09,args_09),
819 BSLS_COMPILERFEATURES_FORWARD(ARGS_10,args_10),
820 BSLS_COMPILERFEATURES_FORWARD(ARGS_11,args_11))
821{
822}
823#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 11
824
825#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 12
826template <class TYPE>
827template <class ARGS_01,
828 class ARGS_02,
829 class ARGS_03,
830 class ARGS_04,
831 class ARGS_05,
832 class ARGS_06,
833 class ARGS_07,
834 class ARGS_08,
835 class ARGS_09,
836 class ARGS_10,
837 class ARGS_11,
838 class ARGS_12>
839SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
840 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
841 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
842 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
843 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
844 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
845 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
846 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
847 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
848 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
849 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
850 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11,
851 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_12) args_12)
852: d_allocator_p(basicAllocator)
853, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
854 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
855 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
856 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
857 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
858 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
859 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07),
860 BSLS_COMPILERFEATURES_FORWARD(ARGS_08,args_08),
861 BSLS_COMPILERFEATURES_FORWARD(ARGS_09,args_09),
862 BSLS_COMPILERFEATURES_FORWARD(ARGS_10,args_10),
863 BSLS_COMPILERFEATURES_FORWARD(ARGS_11,args_11),
864 BSLS_COMPILERFEATURES_FORWARD(ARGS_12,args_12))
865{
866}
867#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 12
868
869#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 13
870template <class TYPE>
871template <class ARGS_01,
872 class ARGS_02,
873 class ARGS_03,
874 class ARGS_04,
875 class ARGS_05,
876 class ARGS_06,
877 class ARGS_07,
878 class ARGS_08,
879 class ARGS_09,
880 class ARGS_10,
881 class ARGS_11,
882 class ARGS_12,
883 class ARGS_13>
884SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
885 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
886 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
887 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
888 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
889 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
890 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
891 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
892 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
893 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
894 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
895 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11,
896 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_12) args_12,
897 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_13) args_13)
898: d_allocator_p(basicAllocator)
899, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
900 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
901 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
902 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
903 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
904 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
905 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07),
906 BSLS_COMPILERFEATURES_FORWARD(ARGS_08,args_08),
907 BSLS_COMPILERFEATURES_FORWARD(ARGS_09,args_09),
908 BSLS_COMPILERFEATURES_FORWARD(ARGS_10,args_10),
909 BSLS_COMPILERFEATURES_FORWARD(ARGS_11,args_11),
910 BSLS_COMPILERFEATURES_FORWARD(ARGS_12,args_12),
911 BSLS_COMPILERFEATURES_FORWARD(ARGS_13,args_13))
912{
913}
914#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 13
915
916#if BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 14
917template <class TYPE>
918template <class ARGS_01,
919 class ARGS_02,
920 class ARGS_03,
921 class ARGS_04,
922 class ARGS_05,
923 class ARGS_06,
924 class ARGS_07,
925 class ARGS_08,
926 class ARGS_09,
927 class ARGS_10,
928 class ARGS_11,
929 class ARGS_12,
930 class ARGS_13,
931 class ARGS_14>
932SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
933 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
934 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
935 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
936 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
937 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
938 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
939 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
940 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
941 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
942 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10,
943 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_11) args_11,
944 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_12) args_12,
945 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_13) args_13,
946 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_14) args_14)
947: d_allocator_p(basicAllocator)
948, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS_01,args_01),
949 BSLS_COMPILERFEATURES_FORWARD(ARGS_02,args_02),
950 BSLS_COMPILERFEATURES_FORWARD(ARGS_03,args_03),
951 BSLS_COMPILERFEATURES_FORWARD(ARGS_04,args_04),
952 BSLS_COMPILERFEATURES_FORWARD(ARGS_05,args_05),
953 BSLS_COMPILERFEATURES_FORWARD(ARGS_06,args_06),
954 BSLS_COMPILERFEATURES_FORWARD(ARGS_07,args_07),
955 BSLS_COMPILERFEATURES_FORWARD(ARGS_08,args_08),
956 BSLS_COMPILERFEATURES_FORWARD(ARGS_09,args_09),
957 BSLS_COMPILERFEATURES_FORWARD(ARGS_10,args_10),
958 BSLS_COMPILERFEATURES_FORWARD(ARGS_11,args_11),
959 BSLS_COMPILERFEATURES_FORWARD(ARGS_12,args_12),
960 BSLS_COMPILERFEATURES_FORWARD(ARGS_13,args_13),
961 BSLS_COMPILERFEATURES_FORWARD(ARGS_14,args_14))
962{
963}
964#endif // BSLMA_SHAREDPTRINPLACEREP_VARIADIC_LIMIT_B >= 14
965
966#else
967// The generated code below is a workaround for the absence of perfect
968// forwarding in some compilers.
969template <class TYPE>
970template <class... ARGS>
971SharedPtrInplaceRep<TYPE>::SharedPtrInplaceRep(Allocator *basicAllocator,
973: d_allocator_p(basicAllocator)
974, d_instance(BSLS_COMPILERFEATURES_FORWARD(ARGS,args)...)
975{
976}
977// }}} END GENERATED CODE
978#endif
979
980template <class TYPE>
981SharedPtrInplaceRep<TYPE>::~SharedPtrInplaceRep()
982{
983 BSLS_ASSERT(0);
984}
985
986// MANIPULATORS
987template <class TYPE>
988inline
989void SharedPtrInplaceRep<TYPE>::disposeObject()
990{
991 SharedPtrInplaceRep_ImpUtil::dispose(d_instance);
992}
993
994template <class TYPE>
995inline
996void SharedPtrInplaceRep<TYPE>::disposeRep()
997{
998 d_allocator_p->deallocate(this);
999}
1000
1001template <class TYPE>
1002inline
1003void *SharedPtrInplaceRep<TYPE>::getDeleter(const std::type_info&)
1004{
1005 return 0;
1006}
1007
1008template <class TYPE>
1009inline
1010TYPE *SharedPtrInplaceRep<TYPE>::ptr()
1011{
1012 return bsls::Util::addressOf(d_instance);
1013}
1014
1015// ACCESSORS
1016template <class TYPE>
1017inline
1018void *SharedPtrInplaceRep<TYPE>::originalPtr() const
1019{
1020 return const_cast<void *>(static_cast<const void *>(
1021 bsls::Util::addressOf(d_instance)));
1022}
1023
1024// ============================================================================
1025// TYPE TRAITS
1026// ============================================================================
1027
1028/// The class template `SharedPtrInplaceRep` appears to use allocators, but
1029/// passes its allocator argument in the first position, rather than in the
1030/// last position, so is not compatible with BDE APIs that use this trait.
1031template <class ELEMENT_TYPE>
1032struct UsesBslmaAllocator<SharedPtrInplaceRep<ELEMENT_TYPE> >
1033 : bsl::false_type {
1034};
1035
1036} // close package namespace
1037
1038
1039#else // if ! defined(DEFINED_BSLMA_SHAREDPTRINPLACEREP_H)
1040# error Not valid except when included from bslma_sharedptrinplacerep.h
1041#endif // ! defined(COMPILING_BSLMA_SHAREDPTRINPLACEREP_H)
1042
1043#endif // ! defined(INCLUDED_BSLMA_SHAREDPTRINPLACEREP_CPP03)
1044
1045// ----------------------------------------------------------------------------
1046// Copyright 2013 Bloomberg Finance L.P.
1047//
1048// Licensed under the Apache License, Version 2.0 (the "License");
1049// you may not use this file except in compliance with the License.
1050// You may obtain a copy of the License at
1051//
1052// http://www.apache.org/licenses/LICENSE-2.0
1053//
1054// Unless required by applicable law or agreed to in writing, software
1055// distributed under the License is distributed on an "AS IS" BASIS,
1056// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1057// See the License for the specific language governing permissions and
1058// limitations under the License.
1059// ----------------------------- END-OF-FILE ----------------------------------
1060
1061/** @} */
1062/** @} */
1063/** @} */
void * getDeleter(const std::type_info &type) BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:433
void * originalPtr() const BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:448
void disposeObject() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:419
void disposeRep() BSLS_KEYWORD_OVERRIDE
Definition bslma_sharedptrinplacerep.h:426
TYPE * ptr()
Definition bslma_sharedptrinplacerep.h:440
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:653
Definition balxml_encoderoptions.h:68
Definition bdldfp_decimal.h:5188
Definition bslmf_integralconstant.h:244
remove_const< typenameremove_volatile< t_TYPE >::type >::type type
Definition bslmf_removecv.h:126
static void * voidify(TYPE *address)
Definition bslma_sharedptrinplacerep.h:373
static const TYPE & forward(const TYPE &reference)
Definition bslma_sharedptrinplacerep.h:358
static void dispose(const TYPE &object)
Destroy the specified object.
Definition bslma_sharedptrinplacerep.h:380
static TYPE * addressOf(TYPE &obj)
Definition bsls_util.h:305