Skip to content

Conversation

@jmdavis
Copy link
Member

@jmdavis jmdavis commented Mar 8, 2025

This is a simple and straightforward trait. It just says whether the template argument is a type or not. It has the same functionality as the trait with the same name in std.traits. However, the implementation is different. The std.traits version just has an alias overload and uses an is expression, whereas it seemed like it would probably be more efficient to split the trait into two and have the kind of argument determine the result, since the compiler has to go through the work of deciding whether the argument matches already, though I don't know enough about the compiler implementation to know for sure that this implementation is better. Either way, it can be changed later if it's determined that the std.traits implementation is better.

This is a simple and straightforward trait. It just says whether the
template argument is a type or not. It has the same functionality as the
trait with the same name in std.traits. However, the implementation is
different. The std.traits version just has an alias overload and uses an
is expression, whereas it seemed like it would probably be more
efficient to split the trait into two and have the kind of argument
determine the result, since the compiler has to go through the work of
deciding whether the argument matches already, though I don't know
enough about the compiler implementation to know for sure that this
implementation is better. Either way, it can be changed later if it's
determined that the std.traits implementation is better.
@jmdavis jmdavis added the Phobos 3 The PR/issue is for Phobos V3. label Mar 8, 2025
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @jmdavis!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#10663"

@thewilsonator thewilsonator merged commit f243f64 into dlang:master Mar 8, 2025
10 checks passed
vpanteleev-sym pushed a commit to vpanteleev-sym/phobos that referenced this pull request Jun 5, 2025
This is a simple and straightforward trait. It just says whether the
template argument is a type or not. It has the same functionality as the
trait with the same name in std.traits. However, the implementation is
different. The std.traits version just has an alias overload and uses an
is expression, whereas it seemed like it would probably be more
efficient to split the trait into two and have the kind of argument
determine the result, since the compiler has to go through the work of
deciding whether the argument matches already, though I don't know
enough about the compiler implementation to know for sure that this
implementation is better. Either way, it can be changed later if it's
determined that the std.traits implementation is better.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Phobos 3 The PR/issue is for Phobos V3.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants