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.9k
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
780
Other Decks in Programming
See All in Programming
SREの越境 / SRE Collaboration
y0hgi
2
310
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.6k
最近”作らせてる” ローカルAIアプリの話
akit37
0
470
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
260
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
Workers Cache を知る
syumai
0
360
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
140
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
380
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Language of Interfaces
destraynor
162
27k
How to make the Groovebox
asonas
2
2.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
The SEO identity crisis: Don't let AI make you average
varn
0
590
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Automating Front-end Workflow
addyosmani
1369
210k
Agile that works and the tools we love
rasmusluckow
331
22k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
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での制限緩和は希望がある!
ありがとうございました