List assertation failure
-
Hi I have the following
struct tcbholder
{
char* tcb;
char programname[8];
// struct stdecs *storageptr;
struct stdecs stdecsx;
list strptr;
list ::iterator stfirstptr;
list ::iterator straverse;
};struct stdecs
{
struct vsmdesc stordesc;
char* tcb;
struct blkdesc ablkdescx;
struct blkdesc fblkdescx;
// struct stdecs* nextdecs;list ablkptr; list::iterator blktraverse; list fblkptr; }
struct blkdesc
{
char type;
int blkaddr;
int blklen;
// struct blkdesc* nextblkdesc;
};I declare a list class
list tcbcollecter;
then a iterator
list ::iterator tcbitrate;
I am able to initialize the main iterator
tcbitrate = tcbcollecter.begin();
However when I try
tcbitrate->straverse = tcbitrate->strptr.begin();
I get the following
_STL_VERIFY(this->_Ptr != _Mycont->_Myhead, "cannot dereference end list iterator");
its in the list member line 151 Dont Understand Thanks
-
Hi I have the following
struct tcbholder
{
char* tcb;
char programname[8];
// struct stdecs *storageptr;
struct stdecs stdecsx;
list strptr;
list ::iterator stfirstptr;
list ::iterator straverse;
};struct stdecs
{
struct vsmdesc stordesc;
char* tcb;
struct blkdesc ablkdescx;
struct blkdesc fblkdescx;
// struct stdecs* nextdecs;list ablkptr; list::iterator blktraverse; list fblkptr; }
struct blkdesc
{
char type;
int blkaddr;
int blklen;
// struct blkdesc* nextblkdesc;
};I declare a list class
list tcbcollecter;
then a iterator
list ::iterator tcbitrate;
I am able to initialize the main iterator
tcbitrate = tcbcollecter.begin();
However when I try
tcbitrate->straverse = tcbitrate->strptr.begin();
I get the following
_STL_VERIFY(this->_Ptr != _Mycont->_Myhead, "cannot dereference end list iterator");
its in the list member line 151 Dont Understand Thanks
It means that your "tcbcollecter" list was empty when you assigned the "tcbitrate" iterator. Calling
begin()
on an empty list will give you theend()
iterator, because there is no real element to point to. You can't dereference it because it doesn't point at anything. -
Hi I have the following
struct tcbholder
{
char* tcb;
char programname[8];
// struct stdecs *storageptr;
struct stdecs stdecsx;
list strptr;
list ::iterator stfirstptr;
list ::iterator straverse;
};struct stdecs
{
struct vsmdesc stordesc;
char* tcb;
struct blkdesc ablkdescx;
struct blkdesc fblkdescx;
// struct stdecs* nextdecs;list ablkptr; list::iterator blktraverse; list fblkptr; }
struct blkdesc
{
char type;
int blkaddr;
int blklen;
// struct blkdesc* nextblkdesc;
};I declare a list class
list tcbcollecter;
then a iterator
list ::iterator tcbitrate;
I am able to initialize the main iterator
tcbitrate = tcbcollecter.begin();
However when I try
tcbitrate->straverse = tcbitrate->strptr.begin();
I get the following
_STL_VERIFY(this->_Ptr != _Mycont->_Myhead, "cannot dereference end list iterator");
its in the list member line 151 Dont Understand Thanks
-
It means that your "tcbcollecter" list was empty when you assigned the "tcbitrate" iterator. Calling
begin()
on an empty list will give you theend()
iterator, because there is no real element to point to. You can't dereference it because it doesn't point at anything. -
How would I solve this problem would calling tcbitrate->push_back solve it after that there is something on the list though the members of tcbcollector have not been assigned values
Instead of trying to manipulate the contents of these structs from outside I would add member functions to do it.
-
Quote:
tcbitrate = tcbcollecter.begin();
Quote:
tcbitrate->straverse = tcbitrate->strptr.begin();
If
tcbcollecter
is empty then the complaint is correct."In testa che avete, Signor di Ceprano?" -- Rigoletto
-
Instead of trying to manipulate the contents of these structs from outside I would add member functions to do it.
Was thinking how to that don’t know if it’s practical my list represents the output of VSMLIST z/os assembler mainframe macro representing the amount allocate free and I unallocated storage for an address space It’s listed by storage blocks ( address and length ) storage descriptors representing a storage subpool which different attributes and storage keys and the TCB task control blocks of the task that own them