gcc

Macで、Apple版じゃないgccを使用してBoostをビルドするときのエラー

いつも忘れるのでメモBoost users' mailing page: Re: [Boost-users] Boost Install on Mac OS X using GCC (1) Create a file user-config.jam in the boost root with the following contents: using darwin : std0x : "/opt/local/bin/g++" : -std=gnu++0…

コンパイラ屋さんが頑張っています。boost屋さんも頑張っています

#include <iostream> #include <boost/preprocessor/repetition/repeat.hpp> #include <boost/preprocessor/arithmetic/add.hpp> #include <boost/preprocessor/cat.hpp> #include <boost/preprocessor/stringize.hpp> #define TEST_MAX 229 #define MAX_CLASS BOOST_PP_CAT(A, TEST_MAX) struct MAX_CLASS; struct A0 { st…</boost/preprocessor/stringize.hpp></boost/preprocessor/cat.hpp></boost/preprocessor/arithmetic/add.hpp></boost/preprocessor/repetition/repeat.hpp></iostream>

ラムダ式のスコープ

namespace lib { namespace detail { struct A { int a_; }; } using detail::A; } int main() { using namespace lib; //error auto f0 = [](int) { A a; }; while(true) { f0(1); } //error auto f1 = [](int i = 0) { A a; }; while(true) { f1(); } //pa…

@160149さんから出た問題。

ある整数に掛けて、平方数にする、できるだけ小さなNを求めよ。bin:sq.exe i.e.) sq 3 -> 3 sq 9 -> 1 sq 12 -> 3 sq 20 -> 5 #include #include #include #include #include typedef std::map Container;bool is_prime(int n) { using namespace pstade::ov…