随笔分类 -  C++

摘要:```cpp #include #include #include #include template struct param_type; template struct param_type { using type = std::tuple_element_t>; }; template st 阅读全文
posted @ 2023-06-19 09:59 fndefbwefsowpvqfx
摘要:https://blog.conan.io/2022/10/13/Different-flavors-Clang-compiler-Windows.html This article will explain the different flavors of Clang C and C++ comp 阅读全文
posted @ 2023-04-13 12:11 fndefbwefsowpvqfx
摘要:Ordered struct node{ int price; int weight; node(int p, int w):price(p), weight(w) {} //Note //1 define as Member function //2 const reference paramet 阅读全文
posted @ 2022-07-30 22:42 fndefbwefsowpvqfx
摘要:1. 生成构建工具 bootstrap 2. 查看有哪些库需要构建 .\b2 --show-libraries 3. build,指定install lib, include的路径,把不需要的库剔除 .\b2 install --build-dir=./build variant=debug add 阅读全文
posted @ 2022-05-05 16:50 fndefbwefsowpvqfx
摘要:![](https://img2022.cnblogs.com/blog/859364/202205/859364-20220505102540775-1136589447.png) 阅读全文
posted @ 2022-05-05 10:26 fndefbwefsowpvqfx
摘要:performing an insertion if such key does not already exist. #include <iostream> #include <map> int main() { std::map<char, int> letter_counts; letter_ 阅读全文
posted @ 2021-10-26 15:14 fndefbwefsowpvqfx
摘要:编译器会给类的非静态成员函数添加一个this参数。 int square(int num) { return num * num; } class Hehe{ public: int square(int num) { return num * num; } }; int main() { int 阅读全文
posted @ 2021-06-28 12:25 fndefbwefsowpvqfx
摘要:class Base{ public: Base() { } virtual ~Base(); void foo() { wrong(); } virtual void wrong() = 0; }; void Base::wrong(){} Base::~Base(){ foo(); } clas 阅读全文
posted @ 2021-06-23 19:35 fndefbwefsowpvqfx
摘要:#include <iostream> class Base { public: Base() { foo(); } void foo() { wrong(); } virtual void wrong() = 0; }; void Base::wrong() { std::cout << "bas 阅读全文
posted @ 2021-06-23 10:09 fndefbwefsowpvqfx
摘要:1 class A { virtual void fun2(); virtual void fun3() {}; }; int main() { new A; return 0; } //LNK2001: unresolved external symbol "private: virtual vo 阅读全文
posted @ 2021-03-30 22:06 fndefbwefsowpvqfx
摘要:CMakeLists.txt cmake_minimum_required(VERSION 3.15) project(Test) enable_language(ASM_NASM) set(CMAKE_C_STANDARD 99) set(ASM_SOURCES test.asm ) set (S 阅读全文
posted @ 2020-12-24 13:42 fndefbwefsowpvqfx
摘要:https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library For more information about C run-time libraries and which libraries 阅读全文
posted @ 2020-12-23 09:42 fndefbwefsowpvqfx
摘要:linux 使用 ldd 查看程序依赖的动态库 $ ldd /usr/bin/bash linux-vdso.so.1 (0x00007ffdd2749000) libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fcecb9b6 阅读全文
posted @ 2020-12-18 13:44 fndefbwefsowpvqfx
摘要:A C++ program is a sequence of text files (typically header and source files) that contain declarations. They undergo translation to become an executa 阅读全文
posted @ 2020-11-23 17:42 fndefbwefsowpvqfx
摘要:https://en.cppreference.com/w/cpp/language/memory_model https://en.cppreference.com/w/cpp/atomic/memory_order First, you have to learn to think like a 阅读全文
posted @ 2020-11-23 15:26 fndefbwefsowpvqfx
摘要:find it easiest to understand move semantics with example code. Let's start with a very simple string class which only holds a pointer to a heap-alloc 阅读全文
posted @ 2020-11-23 15:24 fndefbwefsowpvqfx
摘要:extern "C" makes a function-name in C++ have C linkage (compiler does not mangle the name) so that client C code can link to (use) your function using 阅读全文
posted @ 2020-11-23 15:22 fndefbwefsowpvqfx
摘要:The compiler is allowed to make one implicit conversion to resolve the parameters to a function. What this means is that the compiler can use construc 阅读全文
posted @ 2020-11-23 15:21 fndefbwefsowpvqfx
摘要:I guess you're missing something, here. static function? Declaring a function static will make it "hidden" in its compilation unit. A name having name 阅读全文
posted @ 2020-11-23 15:18 fndefbwefsowpvqfx
摘要:https://www.oracle.com/technical-resources/articles/it-infrastructure/stable-cplusplus-abi.html As C++ evolved over the years, the Application Binary 阅读全文
posted @ 2020-11-23 13:35 fndefbwefsowpvqfx