Move inline attribute inside struct
This commit is contained in:
parent
0ae8754462
commit
baf4f45e65
@ -86,27 +86,19 @@ public:
|
||||
template<typename __ClassType>
|
||||
struct CppObjectTraits {
|
||||
using HandleType = __ClassType*;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = nullptr;
|
||||
static inline void Releasor(HandleType pObject) {
|
||||
delete pObject;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename __ClassType>
|
||||
inline const typename CppObjectTraits<__ClassType>::HandleType
|
||||
CppObjectTraits<__ClassType>::InvalidValue = nullptr;
|
||||
|
||||
template<typename __ClassType>
|
||||
struct CppDynamicArrayTraits {
|
||||
using HandleType = __ClassType*;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = nullptr;
|
||||
static inline void Releasor(HandleType pArray) {
|
||||
delete[] pArray;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename __ClassType>
|
||||
inline const typename CppDynamicArrayTraits<__ClassType>::HandleType
|
||||
CppDynamicArrayTraits<__ClassType>::InvalidValue = nullptr;
|
||||
|
||||
|
||||
|
||||
@ -4,12 +4,9 @@
|
||||
|
||||
struct CapstoneHandleTraits {
|
||||
using HandleType = csh;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = 0;
|
||||
static inline void Releasor(csh Handle) {
|
||||
cs_close(&Handle);
|
||||
}
|
||||
};
|
||||
|
||||
inline const CapstoneHandleTraits::HandleType
|
||||
CapstoneHandleTraits::InvalidValue = 0;
|
||||
|
||||
|
||||
@ -6,37 +6,25 @@
|
||||
|
||||
struct OpensslBIOTraits {
|
||||
using HandleType = BIO*;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = nullptr;
|
||||
static constexpr auto& Releasor = BIO_free;
|
||||
};
|
||||
|
||||
inline const OpensslBIOTraits::HandleType
|
||||
OpensslBIOTraits::InvalidValue = nullptr;
|
||||
|
||||
struct OpensslBIOChainTraits {
|
||||
using HandleType = BIO*;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = nullptr;
|
||||
static constexpr auto& Releasor = BIO_free_all;
|
||||
};
|
||||
|
||||
inline const OpensslBIOChainTraits::HandleType
|
||||
OpensslBIOChainTraits::InvalidValue = nullptr;
|
||||
|
||||
struct OpensslBNTraits {
|
||||
using HandleType = BIGNUM*;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = nullptr;
|
||||
static constexpr auto& Releasor = BN_free;
|
||||
};
|
||||
|
||||
inline const OpensslBNTraits::HandleType
|
||||
OpensslBNTraits::InvalidValue = nullptr;
|
||||
|
||||
struct OpensslRSATraits {
|
||||
using HandleType = RSA*;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = nullptr;
|
||||
static constexpr auto& Releasor = RSA_free;
|
||||
};
|
||||
|
||||
inline const OpensslRSATraits::HandleType
|
||||
OpensslRSATraits::InvalidValue = nullptr;
|
||||
|
||||
|
||||
@ -4,28 +4,19 @@
|
||||
|
||||
struct GenericHandleTraits {
|
||||
using HandleType = HANDLE;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = NULL;
|
||||
static constexpr auto& Releasor = CloseHandle;
|
||||
};
|
||||
|
||||
inline const GenericHandleTraits::HandleType
|
||||
GenericHandleTraits::InvalidValue = NULL;
|
||||
|
||||
struct FileHandleTraits {
|
||||
using HandleType = HANDLE;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = INVALID_HANDLE_VALUE;
|
||||
static constexpr auto& Releasor = CloseHandle;
|
||||
};
|
||||
|
||||
inline const FileHandleTraits::HandleType
|
||||
FileHandleTraits::InvalidValue = INVALID_HANDLE_VALUE;
|
||||
|
||||
struct MapViewTraits {
|
||||
using HandleType = PVOID;
|
||||
static const HandleType InvalidValue;
|
||||
static inline const HandleType InvalidValue = NULL;
|
||||
static constexpr auto& Releasor = UnmapViewOfFile;
|
||||
};
|
||||
|
||||
inline const MapViewTraits::HandleType
|
||||
MapViewTraits::InvalidValue = NULL;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user