#A Only if not trivially destructible
| 27 | |
| 28 | // #A Only if not trivially destructible |
| 29 | ~optional() |
| 30 | requires(not std::is_trivially_destructible_v<T>) |
| 31 | { |
| 32 | if(has_value) { value.as()->~T(); } |
| 33 | } |
| 34 | |
| 35 | // #B If not trivially destructible and has Release method |
| 36 | ~optional() |