I don't mean this to be harsh, but you need to know where you stand. The fact that you think the first example should work shows you lack a fundamental understand of what you are actually doing.
A struct is a new type. Its just a representation of how a chunk of memory of a particular size should be parsed. Even if two structs are identical, you can't expect the compiler to notice and allow implicit casting.
Its the same as:
Code:
int foo;
float bar;
foo = bar
Its a type mismatch.
Now, if the structs are identical, and you want to futz around with pointers a bit, you might have some luck.
Code:
Foo foo;
Bar *bar = (Bar*)&foo;
That would probably build, and might work. But is ickybad voodoo. Stuff you get fired for doing in the real world.
As for the "right" way to do it... Well, remember, in c++ a struct is a just a class with all public members. So, you could either create a copy constructor, or overload the equals operator. Consult your c++ book for details, or google it up.
Chances are, you don't actually want to do what you are trying. There is probably a more direct way to solve whatever problem you are working at.
As far as the template stuff working.... Templates are one of the features of C++ that makes Java a better OO language.