C++ 11 知識,constexpr | Knowledge about C++ 11, constexpr

讀C++ code碰到constexpr,想著應該和const差不多吧,但是既然新造了那麼個關鍵詞出來,肯定用它的作用。查了一下,總結如下:

  1. 如果用在變數聲明,等同const
  2. 如果用在函數聲明,等同inline

Leave a Comment

Your email address will not be published.