with the desctructor of Node i am getting some weird errors, normally i can work template errors out on my own but this error is rather long and hard to understand
btree.h:179: error: no match for 'operator~' in '~* it.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = btree<long int>::Node**, _Container = std::vector<btree<long int>::Node*, std::allocator<btree<long int>::Node*> >]()'
/usr/include/c++/4.3/bits/ios_base.h:105: note: candidates are: std::_Ios_Fmtflags std::operator~(std::_Ios_Fmtflags)
/usr/include/c++/4.3/bits/ios_base.h:145: note: std::_Ios_Openmode std::operator~(std::_Ios_Openmode)
/usr/include/c++/4.3/bits/ios_base.h:183: note: std::_Ios_Iostate std::operator~(std::_Ios_Iostate)
note btree.h:179 refers to the line "~(**it);"
what am i doing wrong here? its an iterator so i need 1 * to dereference and then a second * to dereference the pointer, this should result in ~Node no?
I don't get it. Are you trying to call the destructor? If that's the case:
1. Destructors are not operators. The ~ that goes in front of the class name is merely syntactical. Everywhere else, ~ is the bitwise NOT operator.
2. Destructors can't be explicitly called. Either they are called when deleting a pointer, or automatically called when an object with automatic storage duration goes out of scope.