当前位置:网站首页>Dip1000 implicitly tagged with fields
Dip1000 implicitly tagged with fields
2022-07-02 08:35:00 【fqbqrr】
original text dip1000
Implicit go Closure
Property failed .
struct A {
void method() pure @safe nothrow @nogc {
}
}
void test(scope void delegate() del) @safe {
}
void main() @safe {
A a;
// OK:
void delegate() del = &a.method;
test(&a.method);
}
use -preview=dip1000
Compile time failure , Will interrupt some
Function implementation .
The following will work :
struct A {
int* p;
void method() scope pure @safe nothrow @nogc {
}
}
void test(scope void delegate() del) @safe {
}
void main() @safe {
A a;
test(&a.method);
}
Be careful
1, to Method
Add Domain
, Indicates that the method will not escape this.p
.
2,int* p;
, otherwise , Will ignore the addition Domain
.
The possible fix is , If there are no fields indirect
, Then implicitly give Method
Add Domain
Mark .
边栏推荐
- Detailed explanation of NIN network
- Global and Chinese market of wire loop, 2022-2028: Research Report on technology, participants, trends, market size and share
- Wang extracurricular words
- W10 is upgraded to W11 system, but the screen is black, but the mouse and desktop shortcuts can be used. How to solve it
- install. IMG production method
- STM32-新建工程(参考正点原子)
- Mutex
- sqli-labs第8关(布尔盲注)
- Force buckle method summary: sliding window
- Chrome debugging
猜你喜欢
STM32 new project (refer to punctual atom)
Openfeign is easy to use
IP protocol and IP address
C language replaces spaces in strings with%20
Chrome debugging
OpenCV3 6.2 低通滤波器的使用
Matlab mathematical modeling tool
Use of opencv3 6.2 low pass filter
Smart agriculture solutions smart agriculture system development
sqli-labs第1关
随机推荐
Use C language to receive JSON strings
Don't know mock test yet? An article to familiarize you with mock
Analysis of the use of comparable, comparator and clonable interfaces
One of the reasons for WCF update service reference error
Gateway 简单使用
Static library and dynamic library
Opencv3 6.3 reduced pixel sampling with filters
Wang extracurricular words
用数字 5,5,5,1 ,进行四则运算,每个数字当且仅当用一次,要求运算结果值为 24
OpenFeign 简单使用
Matlab - autres
TCP/IP—传输层
[dynamic planning] p4170: coloring (interval DP)
Force deduction method summary: double pointer
web安全--逻辑越权
SQL operation database syntax
Web安全--核心防御机制
Makefile基本原理
Live broadcast platform development, flexible menu, and freely adjust the horizontal size of the menu bar
方法递归(斐波那契数列,青蛙跳台阶,汉诺塔问题)