Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Exception safety is hardly a "default behavior" of C++, considering such gems[1] as:

    // This is unsafe.
    sink( unique_ptr<widget>{new widget{}},
          unique_ptr<gadget>{new gadget{}} );

    // This is safe.
    sink( make_unique<widget>(), make_unique<gadget>() );
[1] https://herbsutter.com/2013/05/29/gotw-89-solution-smart-poi...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: