当前位置:网站首页>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 .
边栏推荐
- DWORD ptr[]
- Matlab-其它
- File upload Labs
- Summary of one question per day: linked list (continuously updated)
- Call Stack
- Use Wireshark to grab TCP three handshakes
- Sparse matrix storage
- Method recursion (Fibonacci sequence, frog jumping steps, tower of Hanoi problem)
- File upload and download performance test based on the locust framework
- install. IMG production method
猜你喜欢
Generate database documents with one click, which can be called swagger in the database industry
Data asset management function
C language custom type enumeration, Union (clever use of enumeration, calculation of union size)
IP协议与IP地址
Sqli labs Level 2
文件上传-upload-labs
k8s入门:Helm 构建 MySQL
Analysis of the use of comparable, comparator and clonable interfaces
KubeSphere 虚拟化 KSV 安装体验
Solid principle: explanation and examples
随机推荐
什么是SQL注入
OpenCV3 6.2 低通滤波器的使用
Wang extracurricular words
Linked list classic interview questions (reverse the linked list, middle node, penultimate node, merge and split the linked list, and delete duplicate nodes)
Don't know mock test yet? An article to familiarize you with mock
2022 Heilongjiang's latest eight member (Safety Officer) simulated test question bank and answers
DWORD ptr[]
C language implements XML generation and parsing library (XML extension)
sqli-labs第2关
Carsim 学习心得-粗略翻译1
W10 is upgraded to W11 system, but the screen is black, but the mouse and desktop shortcuts can be used. How to solve it
Chrome debugging
Data asset management function
IP协议与IP地址
Googlenet network explanation and model building
Carsim-路面3D形状文件参数介绍
Network security - summary and thinking of easy-to-use fuzzy tester
Simple implementation scheme of transcoding and streaming (I)
Use of opencv3 6.2 low pass filter
Programming ape learning English - imperative programming