Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
memOps.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_CORE_MEMOPS_HPP_
2#define IV_SRC_CORE_MEMOPS_HPP_
3
4namespace iv
5{
12template<typename T>
13T *assignPtr(T **ptr)
14{
15 T *result = nullptr;
16 if (ptr != nullptr)
17 {
18 result = *ptr;
19 *ptr = nullptr;
20 }
21 return result;
22}
23
30template<typename T>
31T *assignPtrNoNull(T **ptr)
32{
33 T *result = nullptr;
34
35 result = *ptr;
36 *ptr = nullptr;
37
38 return result;
39}
40
41}// namespace iv
42
43#endif//IV_SRC_CORE_MEMOPS_HPP_
Definition AlarmsManager.cpp:18
T * assignPtr(T **ptr)
Definition memOps.hpp:13
T * assignPtrNoNull(T **ptr)
Definition memOps.hpp:31