-
-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std.typecons.RefCounted!(T, RefCountedAutoInitialize.no) should still work when T.this() is annotated with @disable
#7797
Conversation
|
Thanks for your pull request, @n8sh! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#7797" |
std/typecons.d
Outdated
| void ensureInitialized() | ||
| void ensureInitialized()() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if making this a zero-args template is the cleanest solution for user-facing code. Would it be better to use a static if?
cc75ab9 to
dafc68d
Compare
@disable@disable
|
Can you please provide some information on why templating the |
|
@RazvanN7 templated code isn't compiled unless instantiated. |
|
What I meant is that you can still call |
|
There's no reason someone couldn't have been calling Is there a better way to check for a |
Right.
Actually, now that you mention, ideally, the method would always be present but it would assert when used
Not that I can think of. |
You mean at runtime rather than compile time? |
Yes |
|
That would make sense if But |
|
You have a point. However, the compilation error needs to be more targeted. IMHO it's a problem if you call ensure initialized but you get some error in the innards of |
…e.no) should still work when T.this() is annotated with `@disable`
|
Added a |
No description provided.