Zeuthen: Writing a C library, part 1
Posted Jun 28, 2011 15:05 UTC (Tue) by
gowen (guest, #23914)
In reply to:
Zeuthen: Writing a C library, part 1 by cmccabe
Parent article:
Zeuthen: Writing a C library, part 1
If I can't use std::string in a destructor, then I can't construct any class that uses std::string in a destructor
Well ... no. You can't.
But I can't think of a sane use case where I would need to, so it's not really a big deal. Can you give a concrete example of where this is a problem, and where a string literal cannot be sensibly used instead?
Follow up question: how would you handle this clean-up in C?
Why would this approach not work in C++ (suitably wrapped as a destructor)?
(
Log in to post comments)