当前位置:网站首页>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);
}
边栏推荐
- 七个好用的装饰器
- ESP series module burning firmware
- Cloud broadcast alert, guanghetong helps intelligent camera to build a "river protection" drowning prevention system
- Market prospect analysis and Research Report of beam combiner in 2022
- golang泛型:generics
- Docker builds a redis Cluster - three machines, three masters and three slaves
- Market prospect analysis and Research Report of single photon counting detector in 2022
- QT日志模块的个性化使用
- Why does the hospital comprehensive security system synchronize the NTP clock of the network server?
- L'avenir est venu, l'ère 5G - Advanced s'ouvre
猜你喜欢

Detailed explanation of network time synchronization (NTP network timing) of video monitoring system

人与人的一些不同

Red team shooting range with three-layer protection

Esp32 development -lvgl uses internal and external fonts

Notes on redisson distributed lock usage

Composition and configuration of GPS Beidou clock synchronization (satellite time synchronization system) in power plant

Linq. pdf

ESP series module burning firmware

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

Cloud broadcast alert, guanghetong helps intelligent camera to build a "river protection" drowning prevention system
随机推荐
Maui migration guide
Vulkan-官方示例解读-RayTracingShadows&在这里边使用模型(1)
Vulkan-官方示例解读-RayTracing
【CustomView】Glide+BitmapTransformation 图片上下边框波浪处理(WaveTransformation)
[cnn]|differences between CNN and transformer
Market prospect analysis and Research Report of seed laser in 2022
Market prospect analysis and Research Report of hydrogen liquefier in 2022
QT日志模块的个性化使用
图像检测相关模型数据格式
B - wall painting (C language)
App live broadcast source code, platform login page and password modification page
Sslstrip Ultimate - location hijacking
A.前缀极差(C语言)
ESP series module burning firmware
Possible problems with password retrieval function (supplementary)
6. form label
Docker swarm installs redis cluster (bitnami/redis cluster:latest)
Discussion on the development trend of remote power management unit (Intelligent PDU)
Eth Transfer
Code replicates CSRF attack and resolves it