style(*): add comments and attribute specifiers
This commit is contained in:
@ -11,6 +11,12 @@ NAMESPACE_MODULE_BEGIN(Utility)
|
||||
|
||||
NAMESPACE_BEGIN(Memory)
|
||||
|
||||
/**
|
||||
* Default constructs a range of items in memory.
|
||||
*
|
||||
* @param Address - The address of the first memory location to construct at.
|
||||
* @param Count - The number of elements to construct.
|
||||
*/
|
||||
template <CDefaultConstructible ElementType>
|
||||
FORCEINLINE void DefaultConstruct(void* Address, size_t Count = 1)
|
||||
{
|
||||
@ -25,6 +31,13 @@ FORCEINLINE void DefaultConstruct(void* Address, size_t Count = 1)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a range of items into memory from a set of arguments. The arguments come from an another array.
|
||||
*
|
||||
* @param Destination - The memory location to start copying into.
|
||||
* @param Source - A pointer to the first argument to pass to the constructor.
|
||||
* @param Count - The number of elements to copy.
|
||||
*/
|
||||
template <typename DestinationElementType, typename SourceElementType = DestinationElementType>
|
||||
requires (CConstructibleFrom<DestinationElementType, const SourceElementType&>)
|
||||
FORCEINLINE void Construct(void* Destination, const SourceElementType* Source, size_t Count = 1)
|
||||
@ -45,6 +58,13 @@ FORCEINLINE void Construct(void* Destination, const SourceElementType* Source, s
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructs a range of items into memory.
|
||||
*
|
||||
* @param Destination - The memory location to start copying into.
|
||||
* @param Source - A pointer to the first item to copy from.
|
||||
* @param Count - The number of elements to copy.
|
||||
*/
|
||||
template <CCopyConstructible ElementType>
|
||||
FORCEINLINE void CopyConstruct(void* Destination, const ElementType* Source, size_t Count = 1)
|
||||
{
|
||||
@ -64,6 +84,13 @@ FORCEINLINE void CopyConstruct(void* Destination, const ElementType* Source, siz
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move constructs a range of items into memory.
|
||||
*
|
||||
* @param Destination - The memory location to start moving into.
|
||||
* @param Source - A pointer to the first item to move from.
|
||||
* @param Count - The number of elements to move.
|
||||
*/
|
||||
template <CMoveConstructible ElementType>
|
||||
FORCEINLINE void MoveConstruct(void* Destination, ElementType* Source, size_t Count = 1)
|
||||
{
|
||||
@ -83,6 +110,13 @@ FORCEINLINE void MoveConstruct(void* Destination, ElementType* Source, size_t Co
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy assigns a range of items.
|
||||
*
|
||||
* @param Destination - The memory location to start assigning to.
|
||||
* @param Source - A pointer to the first item to assign.
|
||||
* @param Count - The number of elements to assign.
|
||||
*/
|
||||
template <CCopyAssignable ElementType>
|
||||
FORCEINLINE void CopyAssign(ElementType* Destination, const ElementType* Source, size_t Count = 1)
|
||||
{
|
||||
@ -102,6 +136,13 @@ FORCEINLINE void CopyAssign(ElementType* Destination, const ElementType* Source,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move assigns a range of items.
|
||||
*
|
||||
* @param Destination - The memory location to start assigning to.
|
||||
* @param Source - A pointer to the first item to assign.
|
||||
* @param Count - The number of elements to assign.
|
||||
*/
|
||||
template <CMoveAssignable ElementType>
|
||||
FORCEINLINE void MoveAssign(ElementType* Destination, ElementType* Source, size_t Count = 1)
|
||||
{
|
||||
@ -121,6 +162,12 @@ FORCEINLINE void MoveAssign(ElementType* Destination, ElementType* Source, size_
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructs a range of items in memory.
|
||||
*
|
||||
* @param Elements - A pointer to the first item to destruct.
|
||||
* @param Count - The number of elements to destruct.
|
||||
*/
|
||||
template <CDestructible ElementType>
|
||||
FORCEINLINE void Destruct(ElementType* Element, size_t Count = 1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user