Houge
Member
|
Memt strange behavior
Hi, I faced a problem with Memt, App is crashing. Here's the code to reproduce:
Code:
/******************************************************************************/
struct keeper
{
private:
Memt<Int> _values;
}
Meml<keeper> values;
/******************************************************************************/
void InitPre()
{
EE_INIT();
App.flag = APP_BREAKPOINT_ON_ERROR;
}
/******************************************************************************/
bool Init()
{
REP(10)values.New();
MREP(values)
{
values.remove(i);
}
return true;
}
/******************************************************************************/
void Shut()
{ }
/******************************************************************************/
bool Update()
{
if(Kb.bp(KB_ESC))return false;
return true;
}
/******************************************************************************/
void Draw()
{
D.clear(TURQ);
}
/******************************************************************************/
If re replace Memt with Memb, it works fine.
(This post was last modified: 09-02-2019 03:31 AM by Houge.)
|
|
09-01-2019 10:17 PM |
|
Esenthel
Administrator
|
RE: Memt strange behavior
please look at MREP macro definition.
You want to use SMREP in this case.
Also Memt is not recommended for permanent storage, but temporary storage inside functions.
|
|
09-02-2019 03:45 AM |
|