【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.2.7.1.7 Array::SetAsOwner
Contents
Description
Sets the array to be owner of the Objects memory, when set the object's will be deleted by the array on resize and during destruction
Syntax
BOOL SetAsOwner( BOOL bIsOwner )
Parameters
- bIsOwner
- [input] A boolean indication if the array should delete (when TRUE) or not on resize
Return
Returns a boolean indicating whether the array was the owner or not (older value)
Examples
EX1
#include <Array.h> struct PERSON { int nID; }; void Array_SetAsOwner_ex1() { Array<PERSON&> arp(false); if ( arp.IsOwner() ) printf("Array arp2 should not be the owner of the items in it."); arp.SetAsOwner(true); if ( !arp.IsOwner() ) printf("Fail to set Array arp as Owner."); }
Remark
See Also
Header to Include
Array.h