Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Section A.4. constexpr functions

A.4. constexpr functions

Integer literals such as 42 are constant expressions. So are simple arithmetic expressions such as 23*2-4. You can even use const variables of integral type that are themselves initialized with constant expressions as part of a new constant expression:

const int i=23;
const int two_i=i*2;
const int four=4;
const int forty_two=two_i-four;


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint