Instantiation of nested structs should be allowed outside their parent scope

Stanislav Blinov stanislav.blinov at gmail.com
Tue Nov 9 16:51:30 UTC 2021


On Tuesday, 9 November 2021 at 16:34:26 UTC, Timon Gehr wrote:

> Sure, which is what I said (do it = copy things). But why would 
> you want the check to behave differently from actual code that 
> copies things?

? Because the check only needs to tell me if copying throws or 
not. That specific check, that is. Nothing else. Because that 
information drives how I allocate or how, exactly, do I copy 
things. Other checks drive other things. BTW, I forgot to show 
one more thing, that is that isNothrowCopyable reduces to 
isCopyable for BetterC. Not Phobos' isCopyable, but an isCopyable 
that tests distinct types because qualifier hell. Which should be 
that same union test from before, only without attributes. But, 
alas, it is not.

For nested structs, such checks need to do things outside of 
context - that's why they MAY behave differently from actual 
code. Compiler doesn't like that. I think it shouldn't not like 
that.


More information about the Digitalmars-d mailing list