Skip to content

Instantly share code, notes, and snippets.

@milleniumbug
Last active October 23, 2015 13:21
Show Gist options
  • Save milleniumbug/1ced08381836a2d4484b to your computer and use it in GitHub Desktop.
Save milleniumbug/1ced08381836a2d4484b to your computer and use it in GitHub Desktop.
exception throwing constructor, usage of naked new and RAII problem
#include <iostream>
#include <cstdlib>
int main()
{
try
{
my::Type instance {1, true, "hello"};
std::cout << instance << std::endl;
}
catch (/* error */)
{
/* report */
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment