Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rustで定数式を扱う
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kazumasa Yamamoto
October 27, 2020
Programming
0
450
Rustで定数式を扱う
Kazumasa Yamamoto
October 27, 2020
Tweet
Share
More Decks by Kazumasa Yamamoto
See All by Kazumasa Yamamoto
ユニークビジョンの Rust 活用事例
fill9120
2
1.7k
Rust & AWS X-Ray による分散トレーシングの実現
fill9120
0
2.8k
Rust製プロダクトを 3年以上運用して得たノウハウ
fill9120
0
1k
Messaging APIを駆使した ChatGPT ボットのUX改善
fill9120
0
370
Rust を開発言語として採用してからの取り組み
fill9120
1
1.8k
ストラクチャードコミュニケーション
fill9120
0
130
Cloudflare PagesにVue.jsアプリをデプロイしてみた
fill9120
0
980
Rustでディープラーニング
fill9120
0
420
LINE BotとLIFFを使って謎解きアプリを作った話
fill9120
0
710
Other Decks in Programming
See All in Programming
AIエージェント、”どう作るか”で差は出るか? / AI Agents: Does the "How" Make a Difference?
rkaga
4
2k
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.4k
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.4k
Architectural Extensions
denyspoltorak
0
290
AI巻き込み型コードレビューのススメ
nealle
2
420
Grafana:建立系統全知視角的捷徑
blueswen
0
330
CSC307 Lecture 01
javiergs
PRO
0
690
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
CSC307 Lecture 10
javiergs
PRO
1
660
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
Featured
See All Featured
Paper Plane
katiecoart
PRO
0
46k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
ラッコキーワード サービス紹介資料
rakko
1
2.3M
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
230
How to Talk to Developers About Accessibility
jct
2
130
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
220
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
Technical Leadership for Architectural Decision Making
baasie
2
250
Designing Powerful Visuals for Engaging Learning
tmiket
0
240
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
440
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での制限緩和は希望がある!
ありがとうございました