The line you are writing
tree<a>::pre_iterator it = my_tree->end();
looks like an assignment, but it will execute a copy constructor. Try to implement a copy constructor for the pre_iterator class and you will see that it is executed.
The copy constructor you should implement is like this:
class pre_iterator
{
pre_iterator(const pre_iterator& __original)
{
}
As templates are not supporting the concept of a user-implemented copy-constructor (they always execute the default copy-constructor), but every constructor (even if it looks like a copy-constructor) is just a constructor, you have to force the match to resolve to your constructor:
tree<A>::pre_iterator it = (const tree<A>::pre_iterator)my_tree->end();
Just tried this and it executed the "copy"-constructor above.