c/c++基本问题

1. 使用g++将文件编译成库文件

  g++ -c -O2 -fPIC test.cpp -o test.o && g++ -shared -Wall -o test.so test.o

  fPIC 作用于编译阶段,告诉编译器产生与位置无关代码

  -fno-elide-constructors:  Specifying this option disables that optimization, and forces G++ to call the copy constructor in all cases

2 .左值、右值定义

  左值:可以取地址的变量

  右值: 1.将亡值(eXpiring Value) 2. 纯右值(Pure Rvalue)

原文地址:https://www.cnblogs.com/457220157-FTD/p/4143453.html