Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rustで定数式を扱う
Search
Kazumasa Yamamoto
October 27, 2020
Programming
480
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rustで定数式を扱う
Kazumasa Yamamoto
October 27, 2020
More Decks by Kazumasa Yamamoto
See All by Kazumasa Yamamoto
ユニークビジョンの Rust 活用事例
fill9120
2
1.8k
Rust & AWS X-Ray による分散トレーシングの実現
fill9120
0
3k
Rust製プロダクトを 3年以上運用して得たノウハウ
fill9120
0
1.1k
Messaging APIを駆使した ChatGPT ボットのUX改善
fill9120
0
400
Rust を開発言語として採用してからの取り組み
fill9120
1
1.9k
ストラクチャードコミュニケーション
fill9120
0
150
Cloudflare PagesにVue.jsアプリをデプロイしてみた
fill9120
0
1.1k
Rustでディープラーニング
fill9120
0
470
LINE BotとLIFFを使って謎解きアプリを作った話
fill9120
0
770
Other Decks in Programming
See All in Programming
Java 27新機能 / Java 27 new features
kishida
2
180
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.5k
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
140
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
240
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
270
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
210
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
440
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
160
Webの地図
yosuke_furukawa
PRO
6
4.9k
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.2k
Featured
See All Featured
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
540
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
290
It's Worth the Effort
3n
188
29k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
We Have a Design System, Now What?
morganepeng
55
8.3k
Rails Girls Zürich Keynote
gr2m
96
14k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
We Are The Robots
honzajavorek
0
380
4 Signs Your Business is Dying
shpigford
187
23k
30 Presentation Tips
portentint
PRO
1
410
Transcript
Rustで定数式を扱う ユニークビジョン株式会社 山本 一将
自己紹介 2 ⚫ 名前:山本 一将(@kyamamoto9120) ⚫ 所属:ユニークビジョン株式会社 ⚫ 言語:C++, Rust,
Python, Ruby ⚫ 趣味:将棋、キャンプ、DIY、野球観戦 ⚫ 実績:2015年 世界コンピュータ将棋選手権9位
アジェンダ 3 ① 定数式とは何か ② Rustの定数式の状況 ③ 簡単な使用方法(フィボナッチ数列を例に)
定数式とは 4 • コンパイル時に評価可能な式のこと • Rustでは const fn で始まる関数が定数式となる
Rustにおける定数式 5 ① 1.31.0から導入 • ローカル変数が使えない • ループ文、制御文が使えない • 引数を&mutにできない
② 1.46.0までに徐々に制限緩和 • ローカル変数が使える! • matchやwhileが使える!
現時点での制限 6 ① for文は使えない ② 評価できる式の深さに制限がある
まとめ 7 ⚫ 制限が一部緩和されたがまだまだ実用レベルではない • 自由度はまだC++14のconstexprにも届かない • 標準ライブラリの対応もまだまだ ⚫ 当面はlazy_static!を使用した方が幸せ
⚫ それでも1.46.0での制限緩和は希望がある!
ありがとうございました