What is the lifetime of a C++ class member. For example, at which time will the `std::fstream` of a `Foo` object be released? When entering the destructor or when leaving the destructor? Is this defined in the C++ standard?

```
struct Foo
{
    std::fstream mystream;
    ~Foo()
    {
        // wait for thread writing to mystream
    }
};

```