Articles
32
Tags
20
Categories
7
首页
时间轴
标签
分类
友链
关于
LDK's Blog
内存序
Back to Home
首页
时间轴
标签
分类
友链
关于
内存序
Created
2025-07-06
|
Updated
2025-07-24
|
Word Count:
68
|
Reading Time:
1mins
|
Post Views:
什么是内存序
内存顺序是指在并发编程中, 对内存读写操作的执行顺序。这个顺序可以被编译器和处理器进行优化, 可能会与代码中的顺序不同, 这被称为指令重排.
Author:
LDK
Link:
https://ldk-blog.cn/2025/07/06/C-Plus-Plus/%E5%B9%B6%E5%8F%91/%E5%86%85%E5%AD%98%E5%BA%8F/
Copyright Notice:
All articles on this blog are licensed under
CC BY-NC-SA 4.0
unless otherwise stated.
Previous
原子操作
原子操作
Next
C++ nodiscard
nodiscard 用于标记函数的返回值: [[nodiscard]] int Compute(); 当调用该函数却不赋值返回结果时,将收到警告: 123void Foo() { Compute();} 1warning: ignoring return value of 'int Compute()', declared with attribute nodiscard 标记整个类型 1234[[nodiscard]]struct ImportantType {};ImportantType CalcSuperImportant(); 每当调用任何返回ImportantType的函数时,都会收到警告。 使用注意 过多使用该关键字可能导致编译器编译时出现大量warning。
LDK
一个软件工程专业在校大学生
Articles
32
Tags
20
Categories
7
Follow Me
Contents
1.
什么是内存序
Recent Posts
大顶堆/小顶堆
2025-07-20
红黑树
2025-07-14
满二叉树
2025-07-13
平衡二叉树(AVL)
2025-07-12
排序算法
2025-07-10