您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DELETE函数代码示例

51自学网 2021-06-01 20:20:50
  C++
这篇教程C++ DELETE函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DELETE函数的典型用法代码示例。如果您正苦于以下问题:C++ DELETE函数的具体用法?C++ DELETE怎么用?C++ DELETE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DELETE函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: DELETE

void asCVariableScope::Reset(){	isBreakScope = false;	isContinueScope = false;	for( asUINT n = 0; n < variables.GetLength(); n++ )		if( variables[n] ) 		{			DELETE(variables[n],sVariable);		}	variables.SetLength(0);}
开发者ID:gookeryoung,项目名称:GKGE,代码行数:12,


示例2: DELETE

ADMVideoMPD3Dlow::~ADMVideoMPD3Dlow(){ 	DELETE(_param);	delete  _uncompressed;	delete  _stored;	delete [] Line;	Line=NULL;	_param=NULL;	_uncompressed=NULL;	_stored=NULL;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:12,


示例3: deleteItem

void QGVector::clear()				// clear vector{    if ( vec ) {	for ( uint i=0; i<len; i++ ) {		// delete each item	    if ( vec[i] )		deleteItem( vec[i] );	}	DELETE(vec);	vec = 0;	len = numItems = 0;    }}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:12,


示例4: DELETE

 void RedisReply::Clear() {     type = 0;     integer = 0;     double_value = 0;     str.clear();     DELETE(elements);     if (self_pool && NULL != pool)     {         pool->Clear();     } }
开发者ID:yinqiwen,项目名称:comms,代码行数:12,


示例5: memset

/** * postSort() runs after sorting has been performed. For ZendArray, postSort() * handles rewiring the linked list according to the results of the sort. Also, * if resetKeys is true, postSort() will renumber the keys 0 thru n-1. */void ZendArray::postSort(Bucket** buffer, bool resetKeys) {  uint last = m_size-1;  m_pListHead = buffer[0];  m_pListTail = buffer[last];  m_pos = (ssize_t)m_pListHead;  Bucket* b = buffer[0];  b->pListLast = NULL;  if (resetKeys) {    memset(m_arBuckets, 0, tableSize() * sizeof(Bucket*));    for (uint i = 0; i < last; ++i) {      Bucket* bNext = buffer[i+1];      b->pListNext = bNext;      bNext->pListLast = b;      if (b->hasStrKey() && b->skey->decRefCount() == 0) {        DELETE(StringData)(b->skey);      }      b->setIntKey(i);      uint nIndex = (i & m_nTableMask);      CONNECT_TO_BUCKET_LIST(b, m_arBuckets[nIndex]);      SET_ARRAY_BUCKET_HEAD(m_arBuckets, nIndex, b);      b = bNext;    }    if (b->hasStrKey() && b->skey->decRefCount() == 0) {      DELETE(StringData)(b->skey);    }    b->setIntKey(last);    uint nIndex = (last & m_nTableMask);    CONNECT_TO_BUCKET_LIST(b, m_arBuckets[nIndex]);    SET_ARRAY_BUCKET_HEAD(m_arBuckets, nIndex, b);    m_nNextFreeElement = m_size;  } else {    for (uint i = 0; i < last; ++i) {      Bucket* bNext = buffer[i+1];      b->pListNext = bNext;      bNext->pListLast = b;      b = bNext;    }  }  b->pListNext = NULL;}
开发者ID:BauerBox,项目名称:hiphop-php,代码行数:45,


示例6: JCLSetGlobalOptions

JILError JCLSetGlobalOptions(JILState* pVM, const JILChar* pOptionString){	JILError err = JIL_No_Exception;	JCLString* pStr;	JCLString* pToken;	JCLOption* pOptions;	JCLState* _this;	if( (_this = pVM->vmpCompiler) == NULL )		return JIL_ERR_No_Compiler;	pStr = NEW(JCLString);	pToken = NEW(JCLString);	JCLSetString(pToken, pOptionString);	pOptions = GetGlobalOptions(_this);	while( !JCLAtEnd(pToken) )	{		// copy up to separator into pStr		JCLSpanExcluding(pToken, ",;", pStr);		// trim any spaces		JCLTrim(pStr);		// something left?		if( JCLGetLength(pStr) )		{			// have option object parse it			err = pOptions->ParseOption(pOptions, pStr, JILHandleRuntimeOptions, pVM);			// handle warnings and errors			if( err )				goto exit;		}		// skip the separator(s)		JCLSpanIncluding(pToken, ",;", pStr);	}exit:	DELETE(pStr);	DELETE(pToken);	return err;}
开发者ID:jewe-1969,项目名称:jilruntime,代码行数:39,


示例7: rbtree_delete

/* ============================================================================= * rbtree_delete * -- Returns TRUE if key exists * ============================================================================= */bool_trbtree_delete (rbtree_t* r, void* key){    node_t* node = NULL;    node = LOOKUP(r, key);    if (node != NULL) {        node = DELETE(r, node);    }    if (node != NULL) {        releaseNode(node);    }    return ((node != NULL) ? TRUE : FALSE);}
开发者ID:amohtasham,项目名称:rstm,代码行数:18,


示例8: DELETE

 RedisDumpFile* Slave::GetNewRedisDumpFile() {     DELETE(m_rdb);     std::string dump_file_path = m_serv->m_cfg.home + "/repl";     char tmp[dump_file_path.size() + 100];     uint32 now = time(NULL);     sprintf(tmp, "%s/temp-%u-%u.rdb", dump_file_path.c_str(), getpid(), now);     NEW(m_rdb, RedisDumpFile);     m_rdb->Init(m_serv->m_db);     m_rdb->OpenWriteFile(tmp);     INFO_LOG("[Slave]Create redis dump file:%s", tmp);     return m_rdb; }
开发者ID:yuanshankongmeng,项目名称:ardb,代码行数:13,


示例9: sp_devices_length

int sp_devices_length() {    int length = 0;    sp_db *th = NEW(sp_db);    if (th && th->m_DB &&        SQLITE_OK != sqlite3_exec(th->m_DB,                                  "SELECT COUNT(id) as length FROM devices",                                  &sp_devices_length_callback,                                  (void *)&length, 0)) {        length = 0;    }    DELETE(th);    return length;}
开发者ID:sergeygaychuk,项目名称:Dispatcher,代码行数:13,


示例10: LoadOperMOTD

	void LoadOperMOTD()	{		ConfigReader* conf = new ConfigReader(ServerInstance);		std::string filename;		filename = conf->ReadValue("opermotd","file",0);		if (opermotd)		{			delete opermotd;			opermotd = NULL;		}		opermotd = new FileReader(ServerInstance, filename);		DELETE(conf);	}
开发者ID:TuSuNaMi,项目名称:ircd-sakura,代码行数:13,


示例11: DELETE

void ZendArray::onSetEvalScalar() {  for (Bucket *p = m_pListHead; p; p = p->pListNext) {    StringData *key = p->skey;    if (p->hasStrKey() && !key->isStatic()) {      StringData *skey= StringData::GetStaticString(key);      if (key && key->decRefCount() == 0) {        DELETE(StringData)(key);      }      p->skey = skey;    }    p->data.setEvalScalar();  }}
开发者ID:DenisBazhan,项目名称:hiphop-php,代码行数:13,


示例12: ReadConfig

	void ReadConfig()	{		ConfigReader* MyConf = new ConfigReader(ServerInstance);		allowchans.clear();		for (int i = 0; i < MyConf->Enumerate("allowchannel"); i++)		{			std::string txt;			txt = MyConf->ReadValue("allowchannel", "name", i);			irc::string channel = txt.c_str();			allowchans[channel] = 1;		}		DELETE(MyConf);	}
开发者ID:TuSuNaMi,项目名称:ircd-sakura,代码行数:13,


示例13: ASSERT

HOT_FUNC_HPHPvoid ZendArray::erase(Bucket ** prev, bool updateNext /* = false */) {  if (prev == NULL)    return;  Bucket * p = *prev;  bool nextElementUnsetInsideForeachByReference = false;  if (p) {    *prev = p->pNext;    if (p->pListLast) {      p->pListLast->pListNext = p->pListNext;    } else {      /* Deleting the head of the list */      ASSERT(m_pListHead == p);      m_pListHead = p->pListNext;    }    if (p->pListNext) {      p->pListNext->pListLast = p->pListLast;    } else {      ASSERT(m_pListTail == p);      m_pListTail = p->pListLast;    }    if (m_pos == (ssize_t)p) {      m_pos = (ssize_t)p->pListNext;    }    int sz = m_strongIterators.size();    for (int i = 0; i < sz; ++i) {      if (m_strongIterators.get(i)->pos == (ssize_t)p) {        nextElementUnsetInsideForeachByReference = true;        m_strongIterators.get(i)->pos = (ssize_t)p->pListNext;        if (!(m_strongIterators.get(i)->pos)) {          // Record that there is a strong iterator out there          // that is past the end          m_flag |= StrongIteratorPastEnd;        }      }    }    m_size--;    // Match PHP 5.3.1 semantics    if ((uint64)p->ikey == (uint64)(m_nNextFreeElement - 1) &&        (p->ikey == 0x7fffffffffffffffLL || updateNext)) {      --m_nNextFreeElement;    }    DELETE(Bucket)(p);  }  if (nextElementUnsetInsideForeachByReference) {    if (RuntimeOption::EnableHipHopErrors) {      raise_warning("The next element was unset inside foreach by reference. "                    "This may lead to unexpeced results.");    }  }}
开发者ID:DenisBazhan,项目名称:hiphop-php,代码行数:51,


示例14: main

int32 main(){        CTest *p1, *p2, *p3;    char* pch1;	CMemMgr* pclMemMgr = TSingleton<CMemMgr>::Instance();    TSingleton<CMutexMgr>::Instance()->Init();        pclMemMgr.Init();	pclMemMgr.Dump(NULL);    NEW(p1, CTest, 1, 1);        NEW(p2, CTest, 2, 2);    NEW(p3, CTest, 3, 3);    p1->print();    p2->print();    p3->print();	pclMemMgr.Dump(NULL);        DELETE(p1);        MALLOC(pch1, char, 10);    p2->print();    p3->print();	pclMemMgr.Dump(NULL);    FREE(pch1);    DELETE(p2);        DELETE(p3);	pclMemMgr.Dump(NULL);    	pthread_t m_resumeThreadId;    pthread_create(&m_resumeThreadId, 0, ResumeMemTask, 0);    	pthread_t m_monitorThreadId;    pthread_create(&m_monitorThreadId, 0, MonitorMemTask, 0);	    while(1) sleep(10);	return 0;}
开发者ID:scanerdong,项目名称:test,代码行数:38,


示例15: CheckPointOperation

 int LMDBEngine::DiscardBatchWrite() {     LMDBContext& holder = m_ctx_local.GetValue();     holder.batch_write--;     if (holder.batch_write == 0)     {         CheckPointOperation* ck = new CheckPointOperation(holder.cond);         m_write_queue.Push(ck);         NotifyBackgroundThread();         ck->Wait();         DELETE(ck);     }     return 0; }
开发者ID:mrkeng,项目名称:ardb,代码行数:14,


示例16: OnCleanup

	void OnCleanup(int target_type, void* item)	{		if(target_type == TYPE_USER)		{			userrec* user = (userrec*)item;			BlockedMessage* m;			user->GetExt("amsgblock", m);			if(m)			{				DELETE(m);				user->Shrink("amsgblock");			}		}	}
开发者ID:TuSuNaMi,项目名称:ircd-sakura,代码行数:14,


示例17: dlclose

void CDlnaFrame::Release(){	CListPlugin::iterator itbegin = m_ListPlugin.begin();	CListPlugin::iterator itend = m_ListPlugin.end();	for (itbegin;itbegin!=itend;++itbegin)	{		CPlugIn *pPlugin = (CPlugIn*)(*itbegin);		/*if(pPlugin->pHandle)			dlclose(pPlugin->pHandle);*/		DELETE(pPlugin);	}		m_ListPlugin.clear();}
开发者ID:FiistSteven,项目名称:easydlna,代码行数:14,


示例18: FROM

void MainTest::deletePost(){    auto count = FROM(db.posts())            WHERE(Post::idField() == postId)            DELETE();    QTEST_ASSERT(count == 1);    count = FROM(db.posts())            WHERE(Post::idField() == postId)            COUNT();    QTEST_ASSERT(count == 0);}
开发者ID:mazandonline,项目名称:Nut,代码行数:14,


示例19: malloc

/*in :    - attribute is the attribute that is tested in the node that's going to be createdout :    - the non-leaf node*/static struct node_t *new_node(const struct attribute_t *attribute){    int i;    struct node_t *ret = malloc(sizeof(*ret));    ret->nb_children = attribute->l_tab;    ret->children = malloc(sizeof(*ret->children) * ret->nb_children);    for(i = 0; i < ret->nb_children; ++i)        ret->children[i] = NULL;    ret->attribute_values = malloc(sizeof(*ret->attribute_values) * ret->nb_children);    for(i = 0; i < ret->nb_children; ++i)        DELETE(ret->attribute_values[i]);    strcpy(ret->property.name_attribute, attribute->property);    return ret;}
开发者ID:hating,项目名称:Ccode,代码行数:20,


示例20: DELETE

void  CHandleOutSearch::SendRequest(const TDesC8& aUrl){	DELETE(iCurUrl);	iCurUrl=aUrl.Alloc();	if(CheckTemp())	{		iState=EHttpOutSearch;		iHttpManager.SendGetRequest(*this,aUrl,EHttpOutSearch);	}	else	{		iObserver.HandleResponseEvent(0,EHttpOutSearch);	}}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:14,


示例21: SceneNode_0SceneNode

/** * SceneNode deconstructor. * @param node The node to free. * /memberof SceneNode */void SceneNode_0SceneNode(SceneNode *node) {	DEBUG_M("Entering function...");	assert(node);	#warning ['TODO']: Free SceneNode memory recusivly, right now it leaks...	DEBUG_H("Deleting mesh...");	DELETE(node->mesh);	node->mesh = NULL;	DEBUG_H("Deleting Child node...");	DELETE(node->child);	DEBUG_H("Deleting next node...");	DELETE(node->next);		DEBUG_H("Deleting rotations...");	List_DeleteData(node->rotations);	DELETE(node->rotations);	node->rotations = NULL;	DEBUG_H("Deleting self...");	free(node);}
开发者ID:dcbishop,项目名称:rcbc,代码行数:28,


示例22: NewIterator

	int Ardb::LastDB(DBID& db)	{		int ret = -1;		Iterator* iter = NewIterator(ARDB_GLOBAL_DB);		if (NULL != iter && iter->Valid())		{			//Skip last KEY_END entry			iter->Prev();		}		if (NULL != iter && iter->Valid())		{			Slice tmpkey = iter->Key();			KeyObject* kk = decode_key(tmpkey, NULL);			if (NULL != kk)			{				db = kk->db;				ret = 0;			}			DELETE(kk);		}		DELETE(iter);		return ret;	}
开发者ID:Ivasek,项目名称:ardb,代码行数:23,


示例23: populate

Document *populate(getc_func getc, void* ctx, int flags){    Cstring line;    Document *a = new_Document();    int c;    int pandoc = 0;    if ( !a ) return 0;    a->tabstop = (flags & MKD_TABSTOP) ? 4 : TABSTOP;    CREATE(line);    while ( (c = (*getc)(ctx)) != EOF ) {	if ( c == '/n' ) {	    if ( pandoc != EOF && pandoc < 3 ) {		if ( S(line) && (T(line)[0] == '%') )		    pandoc++;		else		    pandoc = EOF;	    }	    queue(a, &line);	    S(line) = 0;	}	else if ( isprint(c) || isspace(c) || (c & 0x80) )	    EXPAND(line) = c;    }    if ( S(line) )	queue(a, &line);    DELETE(line);    if ( (pandoc == 3) && !(flags & (MKD_NOHEADER|MKD_STRICT)) ) {	/* the first three lines started with %, so we have a header.	 * clip the first three lines out of content and hang them	 * off header.	 */	Line *headers = T(a->content);	a->title = headers;             header_dle(a->title);	a->author= headers->next;       header_dle(a->author);	a->date  = headers->next->next; header_dle(a->date);	T(a->content) = headers->next->next->next;    }    return a;}
开发者ID:devontech,项目名称:discount,代码行数:50,


示例24: f

void f() {    int *a = new int(5); // expected-note2 {{allocated with 'new' here}}    delete[] a;          // expected-warning {{'delete[]' applied to a pointer that was allocated with 'new'; did you mean 'delete'?}}    int *b = new int;    delete b;    int *c{new int};    // expected-note {{allocated with 'new' here}}    int *d{new int[1]}; // expected-note2 {{allocated with 'new[]' here}}    delete  [    ] c;   // expected-warning {{'delete[]' applied to a pointer that was allocated with 'new'; did you mean 'delete'?}}    // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:17}:""    delete d;           // expected-warning {{'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'?}}    // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:9}:"[]"    DELETE_ARRAY(a);    // expected-warning {{'delete[]' applied to a pointer that was allocated with 'new'; did you mean 'delete'?}}    DELETE(d);          // expected-warning {{'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'?}}}
开发者ID:RichardsonAlex,项目名称:clang-1,代码行数:14,


示例25: Delete_Element

node  Delete_Element(tree t, node Parent, void * data, int *H, int * found, void * found_data){    node Temp;    if(!Parent)    {        printf("/n datarmation does not exist");        return(Parent);    }    else    {        if (t->comp(data, Parent->data) < 0)        {            Parent->left = Delete_Element(t, Parent->left, data, H, found, found_data);            if(*H)                Parent = Balance_Right_Heavy(Parent, H);        }        else if(t->comp(data, Parent->data) > 0)        {            Parent->right = Delete_Element(t, Parent->right, data, H, found, found_data);            if(*H)                Parent = Balance_Left_Heavy(Parent, H);        }        else        {            *found = 1;            *((int*)found_data) = (int) Parent->data;            Temp= Parent;            if(Temp->right == NULL)            {                Parent = Temp->left;                *H = T;                free(Temp);            }            else if(Temp->left == NULL)            {                Parent = Temp->right;                *H = T;                free(Temp);            }            else            {                Temp->left = DELETE(Temp->left, Temp, H);                if(*H)                    Parent = Balance_Right_Heavy(Parent, H);            }        }    }    return(Parent);}
开发者ID:kshmir,项目名称:tla-2012,代码行数:50,


示例26: DELETE

CSearchResultView::~CSearchResultView(){	DELETE(iTitle);	DELETE(iInSearch);	DELETE(iShowInfo);	DELETE(iShowGrade);	DELETE(iUrl);	DELETE(iTempBuf);	}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:9,


示例27: if

//From MOperationObservervoid CHandleOutSearch::OperationEvent(TInt aEventType,const TDesC& aEventData,TInt aType){	TInt eventType=aEventType;	if(aEventType==EHttpNoError)	{		if(aType==EHttpOutSearch)		{			::WriteFile(iFileName,aEventData);			this->HandlePageWml();		}		else if(aType==EHttpOutSearchError)		{			DELETE(iErrorInfo);			iErrorInfo=aEventData.Alloc();			DELETE(iBuf);			iBuf=aEventData.Alloc();			eventType=EHttpContentError;		}	}	else	{		DELETE(iBuf);		iBuf=aEventData.Alloc();	}	if(aType!=EHttpOutSearchKeyWord)	{		if(iContentError)		{			iObserver.HandleResponseEvent(EHttpContentError,aType);			iContentError=EFalse;		}		else			iObserver.HandleResponseEvent(eventType,aType);	}}
开发者ID:flaithbheartaigh,项目名称:wapbrowser,代码行数:38,


示例28: m4_delete

voidm4_delete (m4 *context){  size_t i;  assert (context);  if (context->symtab)    m4_symtab_delete (context->symtab);  if (context->syntax)    m4_syntax_delete (context->syntax);  /* debug_file should have been reset to stdout or stderr, both of     which are closed later.  */  assert (context->debug_file == stderr || context->debug_file == stdout);  obstack_free (&context->trace_messages, NULL);  if (context->search_path)    {      m4__search_path *path = context->search_path->list;      while (path)        {          m4__search_path *stale = path;          path = path->next;          DELETE (stale->dir); /* Cast away const.  */          free (stale);        }      free (context->search_path);    }  for (i = 0; i < context->stacks_count; i++)    {      assert (context->arg_stacks[i].refcount == 0              && context->arg_stacks[i].argcount == 0);      if (context->arg_stacks[i].args)        {          obstack_free (context->arg_stacks[i].args, NULL);          free (context->arg_stacks[i].args);          obstack_free (context->arg_stacks[i].argv, NULL);          free (context->arg_stacks[i].argv);        }    }  free (context->arg_stacks);  free (context);}
开发者ID:collects,项目名称:m4,代码行数:49,



注:本文中的DELETE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ DELETEP函数代码示例
C++ DELAY_US函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。