2010-08-03から1日間の記事一覧

Variadic TemplatesでBoost.Format拡張

C++

かなり前に書いてから埋もれていたので、載せておきます。 サンプルコード #include <iostream> #include <cassert> #include <shand/format.hpp> int main() { // variadic bind const std::string s1 = shand::format("%1% %2% %3%", "Hello", "World", 3.14).str(); assert(s1 == "Hello World </shand/format.hpp></cassert></iostream>…