I'm having a small little issue with a new piece of code I've been working on. And after I asked around, and no answers could be found, I figured it would be best to turn to the community as a whole for some simple help.
Edit: Example usage:: Remove<DESCRIPTOR_DATA>(descriptor_list, d);
This is the code in question, the design behind this is a safe-remove function for a std::list.
As most know, std::lists on remove, remove all occasions of entity, and some versions of remove, if the entity isn't in the list when it is called, has a nice tendancy to explode. I think this issue is more compiler specific then anything. In anycase, I wrote this up, as well as several other little functions that fit my core design quite nicely.
They all have the same issue, and here it is:
Tools.h: In function void Daemon::Remove(std::list<var_type*, std::allocator<var_type*> >&, var_type*): Tools.h:24: error: expected `;' before where_it_is Tools.h:26: error: where_it_is was not declared in this scope
it has been suggested that std::list<var_type *>::iterator where_it_is; could of been using a std odd name, and it was also thought that because var_type is a template<class var_type> that std::list may not except a template within, well, a template. However, varying docs on lists say it is possible (and even give examples) though I seem to explode with this.
So if anyone can lend a hand to figure out the error in question, please do. Oh, and before you say you need to see all the code before it, know that compiling this piece of code, will explode the same way, just with new line-numbers (or if you forget to include <list> )
I'm having a small little issue with a new piece of code I've been working on. And after I asked around, and no answers could be found, I figured it would be best to turn to the community as a whole for some simple help.
Edit: Example usage:: Remove<DESCRIPTOR_DATA>(descriptor_list, d);
This is the code in question, the design behind this is a safe-remove function for a std::list.
As most know, std::lists on remove, remove all occasions of entity, and some versions of remove, if the entity isn't in the list when it is called, has a nice tendancy to explode. I think this issue is more compiler specific then anything. In anycase, I wrote this up, as well as several other little functions that fit my core design quite nicely.
They all have the same issue, and here it is:
Tools.h: In function void Daemon::Remove(std::list<var_type*, std::allocator<var_type*> >&, var_type*):
Tools.h:24: error: expected `;' before where_it_is
Tools.h:26: error: where_it_is was not declared in this scope
it has been suggested that std::list<var_type *>::iterator where_it_is; could of been using a std odd name,
and it was also thought that because var_type is a template<class var_type> that std::list may not except a template within, well, a template. However, varying docs on lists say it is possible (and even give examples) though I seem to explode with this.
So if anyone can lend a hand to figure out the error in question, please do. Oh, and before you say you need to see all the code before it, know that compiling this piece of code, will explode the same way, just with new line-numbers (or if you forget to include <list> )
Cheers, and thanks in advance for any help!