Last active
August 29, 2015 13:55
-
-
Save bkuhns/8689289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <boost/tuple/tuple.hpp> | |
#include <string> | |
using namespace std; | |
typedef boost::tuple<int, string> tuple_type; | |
struct inherits_from_tuple : public tuple_type | |
{ | |
inherits_from_tuple() | |
: tuple_type(2, "QWERTYUIOP"), | |
s_("ASDFGHJKLZXCVBNMQWETRYUIOP") | |
{ | |
} | |
string s_; | |
}; | |
int main() | |
{ | |
while(true) { | |
tuple_type* test = new inherits_from_tuple(); | |
delete test; //< Leaks the member s because only tuple_type's destructor is called. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment