In the following scenario:
struct Foo { // ... operator Bar() {... } // implicit cast to Bar } Foo GetFoo() { ... } void CallMeBar(Bar x) { ... } // ...
As long as you return them by value, they survive until CallMeBar is finished.
Your cast operator is a little off, though. Should be:
struct Foo { // ... operator Bar() {... } // implicit cast to Bar }
See e.g. http://msdn.microsoft.com/en-us/library/ts48df3y(VS.80).aspx