>> Like this?
Yes. You might also consider taking the string as a const reference, although that shouldn't be a big deal.
>> they all have been constructor calls for that type. Right?
Pretty much, yes. Obviously plain old datatypes don't actually have constructors, but the idea is the same.
>> So if I throw before allocating, there would still be a memory leak?
If you throw before allocating, then there would not be a leak. If you throw after allocating, there would be a leak (unless you deallocate before throwing). However, in most cases (at least in your pseudocode) you don't need to do any allocating on your own, so you don't have to worry about it. The ifstream and string classes will clean themselves up.