-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright 2024 Nokia | ||
* Licensed under the BSD 3 Clause license | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
// *********************************************************************************************** | ||
// - why: | ||
// . example to support SafePtr & shared_ptr as UniData | ||
// . users can modify this file for their req | ||
// - why support shared_ptr? | ||
// . from mem-safe pov, SafePtr is the only choice | ||
// . shared_ptr may be same safe as SafePtr, then SafePtr is unnecessary | ||
// *********************************************************************************************** | ||
#pragma once | ||
|
||
#include <memory> // make_shared | ||
|
||
using namespace std; | ||
|
||
namespace RLib | ||
{ | ||
|
||
#if 1 | ||
using UniData = shared_ptr<void>; | ||
#define MAKE_UNI_DATA make_shared | ||
#else | ||
using UniData = SafePtr<void>; | ||
#define MAKE_UNI_DATA make_safe | ||
#endif | ||
|
||
} // namespace | ||
// *********************************************************************************************** | ||
// YYYY-MM-DD Who v)Modification Description | ||
// .......... ......... ....................................................................... | ||
// 2024-02-13 CSZ 1)create | ||
// *********************************************************************************************** |