さらば Format()
(開発メモ)
Print() / Println() / LOG() で導入した Variadic Templates による文字列フォーマットを Font::operator() で使えば、コードの大部分から Format() を削除できることに気付いた。非常に書きやすく読みやすい。図形の .draw() と一貫性がある。
Before
# include <Siv3D.hpp> void Main() { const Font font{ 20 }; while (System::Update()) { font.draw(Format(L"frame: ", System::FrameCount()), 50, 50); } }
After
# include <Siv3D.hpp> void Main() { const Font font{ 20 }; while (System::Update()) { font(L"frame: ", System::FrameCount()).draw(50, 50); } }
Siv3D March 2014 から導入し、古い記法は問題が無ければ deprecated にしていく。