offa / scope-guard

Implementation of Scoped Guards and Unique Resource as proposed in P0052.
MIT License
46 stars 6 forks source link

Mctor is only valid if EF is either copy- or move-constructible #124

Closed offa closed 6 years ago

offa commented 6 years ago

Mctor is only valid if EF is either copy- or move-constructible:

This constructor does not take part in overload resolution unless the expression (is_nothrow_move_constructible_v || is_copy_constructiblev) is true. (§ 7.5.2/21)_

Ref. #117

offa commented 6 years ago

Remarks: The expression inside noexcept is equivalent to is_nothrow_move_constructible_v || is_nothrow_copy_constructible_v. This constructor does not take part in overload resolution unless the expression (is_nothrow_move_constructible_v || is_copy_constructible_v) is true.

This causes noexcept to evaluate to always true as it is otherwise SFINAE'd out.

offa commented 6 years ago

Relates to #121