次の点での違いは何ですか。
#include <iostream>
using namespace std;
int get_value(int value){
return 3 * value;
}
int main(int argc, const char * argv[])
{
const int a = 5;
const int b = get_value(4);
return 0;
}
const int a が bss セクションに格納され、 const int b が格納されず、両方がコンパイラによって引き続き適用されるという唯一の違いです。
したがって、bssに保存されているため、高速ですか?const in a はコンパイル時に計算されるため、これは constexpr の使用例ですか? constexpr は、bss セクションに格納されている b に const を作成しますか?
ブレア