Reputation: 106549
I'm wondering if I need an RAII wrapper around std::fstream
....
Upvotes: 0
Views: 175
Reputation: 507005
No you don't. It closes the file. § 27.8.1.2
:
virtual ˜basic_filebuf();
Effects: Destroys an object of class basic_filebuf. Calls close().
(which is contained as an object within std::fstream
(§ 27.8.1.11
), thus being destructed when the fstream
is destructed).
Upvotes: 6