摘要:Linux 不需要装MinGW,需要设置两个地方 1 Project->Properties->C\C++ Build->Settings->在右边选择Binary Parsers->勾选GUN ELF Parser然后右下角点Apply and Close; 2 Project->Properti
阅读全文
摘要:#include #include #include using namespace std; using namespace std::placeholders; void test(int i, double d, const string &s) { cout fp; string s = "foo"; int a = 3; double b =...
阅读全文
摘要:// C++11 function #include void print_num(int i) { std::cout getSum = [&](const int &nI1, const int &nI2) { int nSum = nI1 + nI2; std::cout f_display_42 = []() { print_num(42); }; f_displa...
阅读全文
摘要:什么是placement new?所谓placement new就是在用户指定的内存位置上构建新的对象,这个构建过程不需要额外分配内存,只需要调用对象的构造函数即可。举例来说:class foo{};foo* pfoo = new foo;pfoo指向的对象的地址你是不能决定的,因为new已经为你做
阅读全文