I've looked up multiple questions related to this but haven't found a satisfying answer. So:
- What does constexpr do, when applied to a function?
- Why should we use constexpr on functions? What's a big difference between using it and not using it?
- Could you provide some examples regarding constexpr functions?
I am asking this because I noticed that for example, std::array provides constexpr member functions to overload operator []. What's the reason behind having overloaded operator [] as constexpr?
Thanks in advance!