Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
ObjectForSideEffects.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
6
7 /*
8 ********************************************************************************
9 ************************* Common::EmptyObjectForSideEffects ********************
10 ********************************************************************************
11 */
12 template <typename CONSTRUCTOR_CALL>
13 inline EmptyObjectForSideEffects::EmptyObjectForSideEffects (CONSTRUCTOR_CALL&& ctorCall)
14 {
15 forward<CONSTRUCTOR_CALL> (ctorCall) ();
16 }
17
18 /*
19 ********************************************************************************
20 ************************** Common::ObjectForSideEffects ************************
21 ********************************************************************************
22 */
23 template <typename CONSTRUCTOR_CALL, typename DESTRUCTOR_CALL>
24 inline ObjectForSideEffects::ObjectForSideEffects (CONSTRUCTOR_CALL&& ctorCall, DESTRUCTOR_CALL&& dtorCall)
25 : fDestructor_ (dtorCall) // no {} to allow conversion
26 {
27 forward<CONSTRUCTOR_CALL> (ctorCall) ();
28 }
29 inline ObjectForSideEffects::~ObjectForSideEffects ()
30 {
31 fDestructor_ ();
32 }
33
34}
EmptyObjectForSideEffects(CONSTRUCTOR_CALL &&ctorCall)
Sometimes you want to sequence some code around mem-initializers. SOMETIMES - if those mem-initialize...