Hello,
what are the rules for @nogc inference? It looks like sometimes
compiler can infer @nogc, but not in this simplest case:
int x()
{
return 1;
}
void main() @nogc
{
x();
}
Thanks!
On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote:
what are the rules for @nogc inference?
It attempts it if and only if it is a template.
On 11/15/18 4:09 PM, Adam D. Ruppe wrote:
On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote:
what are the rules for @nogc inference?
It attempts it if and only if it is a template.
Well, the general "rule" is, if it's code that must be available to the
compiler when it's called, the
On Thursday, 15 November 2018 at 21:55:18 UTC, Steven
Schveighoffer wrote:
On 11/15/18 4:09 PM, Adam D. Ruppe wrote:
On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote:
what are the rules for @nogc inference?
It attempts it if and only if it is a template.
Well, the general "rule" is
On Friday, 16 November 2018 at 10:25:26 UTC, ikod wrote:
On Thursday, 15 November 2018 at 21:55:18 UTC, Steven
Schveighoffer wrote:
On 11/15/18 4:09 PM, Adam D. Ruppe wrote:
On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote:
what are the rules for @nogc inference?
It attempts it if a
On Friday, 16 November 2018 at 12:12:12 UTC, Alex wrote:
=
This code compiles as long as `lazy` is commented out. But I'd
like to have
both lazy parameter and @nogc inferrence for `library_func` so
that user is not locked to code @nogc or not.
On Thursday, 15 November 2018 at 21:55:18 UTC, Steven
Schveighoffer wrote:
On 11/15/18 4:09 PM, Adam D. Ruppe wrote:
On Thursday, 15 November 2018 at 21:00:48 UTC, ikod wrote:
what are the rules for @nogc inference?
It attempts it if and only if it is a template.
Well, the general "rule" is
On Fri, 30 Nov 2018 20:41:03 +, ikod wrote:
> I can't find the reason why nogc/nothrow can't be inferred in this case:
>
> class S(K,V)
> {
> auto get/*()*/(K a) {
> return 0;
> }
> }
> void main() @nogc nothrow {
> S!(int, string) sia;
> auto v = sia.get(1);
> }
On Friday, 30 November 2018 at 21:03:06 UTC, Neia Neutuladh wrote:
On Fri, 30 Nov 2018 20:41:03 +, ikod wrote:
I can't find the reason why nogc/nothrow can't be inferred in
this case:
class S(K,V)
{
auto get/*()*/(K a) {
return 0;
}
}
void main() @nogc nothrow {
S!(
On Fri, 30 Nov 2018 22:10:11 +, ikod wrote:
> Thanks for explanation, got it.
>
> My case is actually
>
> interface I(K,V)
> {
> int get()(K);
> }
Interface functions must be abstract. Templated functions are implicitly
final. Final things can't be abstract.
If there's something about
10 matches
Mail list logo