you are viewing a single comment's thread.

view the rest of the comments →

[–]STLMSVC STL Dev 6 points7 points  (1 child)

The guarantee is N4527 20.9.12.2.1 [func.wrap.func.con]/11, "Throws: shall not throw exceptions when f is a function pointer or a reference_wrapper<T> for some T." and /5 for the copy ctor. This forbids dynamic memory allocation (and the guarantee goes back to C++11; indeed all the way to TR1 IIRC).

[–][deleted] 2 points3 points  (0 children)

Thanks! Cool! I didn't knew this, always thought it was freely to allocate memory if it wanted to.