You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support `_ =` as a discard operation
- for example, `_ = vec.emplace_back(a,b,c);`
- emitted as `(void)`, not `std::ignore =` because the latter doesn't work with `void` returns and we want to support generic code where there might or might not be a return value in a given template instantiation
Make UFCS calls unconditionally add [[nodiscard]] always
- note: only added on compilers that support C++23's P2173
Take back `_ :=` as an anonymous deduced variable syntax - the name can be anonymous or the type can be anonymous, but not both
- yes, it would be easy to support making both anonymous (it did work before this commit, which had to explicitly add a check to disable it)
- rationale: if that were allowed to keep the returned object alive, that syntax would be dangerously close to '_ = f();' to discard the returned object, which is exactly opposite in a fundamentally important way (lifetime!) and such importantly opposite meanings deserve more than a one-character typo distance
- explicit discarding gets the nice syntax because it's likely more common
- but this shouldn't be any hardship because cases that use a type are still just as easy, e.g., `lock_guard`; before this commit `_ := lock_guard(mut);` worked, and after this commit that's disallowed but it's just as easy to write `_: lock_guard = mut;`
- to make this natural also for `finally`, I just got rid of the `finally` and `finally_success` helper functions, and gave those names to the types... it's a simpler design and I think an improvement in its own right, and `_: finally = code;` is slightly simpler to write (e.g., saves `(` `)` `;`, for example see `pure2-types-order-independence-and-nesting.cpp2`)
Remove return type from `contract_group::set_handler`
- not needed, since we already have `get_handler` if the current value is of interest
Add reflection `default_to_*` functions for `make_*` functions that ignore the returned bool
- arguably a clearer API, makes calling code intent more readable
0 commit comments