constexpr
Re: constexpr
Maybe this will help
https://en.cppreference.com/w/cpp/language/constexpr
https://en.cppreference.com/w/cpp/language/constexpr
Curiosity killed the cat, satisfaction brought him back
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: constexpr
global and function level constexpr don't have to have static, but member constexpr variables do because they are scoped to the class, but not a part of any one instance of the class.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: constexpr
Oh, another thing I've learned is if you try to take a reference or address of a constexpr, you will have to make sure to define or initialize the variable in namespace scope like any other static variable.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com