2011-10-01から1ヶ月間の記事一覧

初めてQuine書いてみた

C++

難しい。あと、全然スマートじゃないような。そして改めてid:rofiたんすごいと思った。*1 #include <iostream> #include <string> int main() { char c = 44, d = 34; std::string s[] = { "#include <iostream>", "#include <string>", "int main() {", "char c = 44, d = 34;", "std::string s[</string></iostream></string></iostream>…

fizzbuzz

C++

昔のエントリにもなんか書いた気がするけどそっちは気にしないことにしたんだ、俺。 #include <iostream> #include <sstream> int main(int c,char **v){if(c!=2){if(&(std::cout<<"argument error!: a count is needed.")){}}else{if(std::stringstream ss=std::stringstream(v</sstream></iostream>…

phoenix使い始め。(lazy_make_shared)

phoenixが強力らしいので使ってみることにした。 main.cpp #include <iostream> #include <vector> #include <boost/spirit/home/phoenix.hpp> #include <pstade/oven/algorithm.hpp> #include <pstade/oven/initial_values.hpp> #include "./lazy_make_shared.hpp" class A { public: A(int n) : n_(n) { std::cout << "created(" << n << ")"…</pstade/oven/initial_values.hpp></pstade/oven/algorithm.hpp></boost/spirit/home/phoenix.hpp></vector></iostream>

札幌C++勉強会#3を開催しました!

C++

先日10/01、札幌C++勉強会#3を開催しました。 http://atnd.org/events/19719参加者の方々、運営の方々ありがとうございました、お疲れさまでした〜。今回は第三回。内容は11/05に開催のBoost.勉強会に向けて、どう書く.org辺りから拾ってきたネタをBoostを使…