Skip to content

Conversation

JohelEGP
Copy link
Contributor

No description provided.

@JohelEGP JohelEGP marked this pull request as ready for review January 25, 2024 19:05
@hsutter
Copy link
Owner

hsutter commented Jan 25, 2024

@filipsajdak @JohelEGP Will this conflict with #701? My impression is #701 is almost ready to review again?

@filipsajdak
Copy link
Contributor

@hsutter #701 is() part is ready. I need to split this PR into two. One for is() and one for as()

@JohelEGP
Copy link
Contributor Author

Will this conflict with #701?

Yes, that's intentional.
This PR provides the first the first and most important step
to rein in the complexity of adding more is overloads.

@hsutter
Copy link
Owner

hsutter commented Feb 1, 2024

Thanks! This is looking good.

The only thing I notice is that it passes CI on everything except Xcode 13. Looks like the only problem is that Xcode 13 doesn't have C++20 iter_reference_t which is used in one condition.

I've pushed a commit to this PR to try to eliminate that dependency by adding this:

template <typename T>
    requires requires { *std::declval<T&>(); }
using deref_t = decltype(*std::declval<T&>());

... and using that instead of iter_reference_t.

Does that seem like the right solution? Hopefully that will unbreak Xcode 13... Now that we have CI (thanks again!) I can push and find out...

@hsutter
Copy link
Owner

hsutter commented Feb 1, 2024

Yup, that unbroke Xcode 13... should be ready to merge. Thanks!

@hsutter hsutter merged commit a7eff44 into hsutter:main Feb 1, 2024
@JohelEGP JohelEGP deleted the operator_is branch February 1, 2024 03:28
bluetarpmedia pushed a commit to bluetarpmedia/cppfront that referenced this pull request Feb 7, 2024
* refactor(util): merge built-in `is`/`as` type overloads

* Remove dependency on C++20 feature Xcode 13 doesn't have

---------

Co-authored-by: Herb Sutter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants