当前位置:网站首页>D structure as index of multidimensional array
D structure as index of multidimensional array
2022-06-11 04:12:00 【fqbqrr】
import std.stdio;
import std.format;
struct indexedPair {
size_t x, y;
}
struct MyArray {
bool[3][3] elements;
ref opIndex(indexedPair i) {
return elements[i.y][i.x];
}
}
void main() {
auto arr = MyArray();
auto p = indexedPair(1, 1);
arr[p] = true;
writeln(arr);
}
边栏推荐
- Summary of C language implementation of BP neural network
- Pictures that make people feel calm and warm
- Lexical analyzer for compiling principle notes
- golang泛型:generics
- [激光器原理与应用-2]:国内激光器重点品牌
- Unity prefab scene conflict merge tool unityyamlmerge
- Some differences between people
- Implementation of one-dimensional convolutional neural network CNN based on FPGA (V) data quantization (with code)
- Embedded basic interface SDIO
- Market prospect analysis and Research Report of hydrogen liquefier in 2022
猜你喜欢

7. 列表标签

Management system of College Students' associations based on SSM

AI助力,释放法务势能!iTerms合同智审系统重磅发布

Matter protocol

Guanghetong won the "science and Technology Collaboration Award" of Hello travel, driving two rounds of green industries to embrace digital intelligence transformation

A - Eddy‘s AC难题(C语言)

Safe and borderless, Guanghe tongdai 5g module +ai intelligent security solution shines at CPSE Expo
![[激光器原理与应用-2]:国内激光器重点品牌](/img/55/a87169bb75429f323159e3b8627cc6.jpg)
[激光器原理与应用-2]:国内激光器重点品牌

零时科技 | Discover 闪电贷攻击事件分析

Rational use of thread pool and thread variables
随机推荐
AI助力,释放法务势能!iTerms合同智审系统重磅发布
2022-06-10:薯队长从北向南穿过一片红薯地(南北长M,东西宽N),红薯地被划分为1x1的方格, 他可以从北边的任何一个格子出发,到达南边的任何一个格子, 但每一步只能走到东南、正南、西南方向的
编程大作战 -- 挑战高考题
检测php网站是否已经被攻破的方法
Protection and bypass of repeated contracting
Guanghetong 5g module shines brightly and has won the "2021 science and technology award of China Electronics Society"
零时科技 | Discover 闪电贷攻击事件分析
Some differences between people
A - Eddy‘s AC难题(C语言)
Market prospect analysis and Research Report of engraving laser in 2022
Discussion on the development trend of remote power management unit (Intelligent PDU)
使用工具类按一定规则读取Excel文件
七个好用的装饰器
详解 | 晶振的构造及工作原理
2022爱分析· 隐私计算厂商全景报告 | 爱分析报告
Unity prefab scene conflict merge tool unityyamlmerge
Exploitation and utilization of clickjacking vulnerability
写给通信年轻人的27个忠告
App live broadcast source code, platform login page and password modification page
A.前缀极差(C语言)