What is the purpose of marking the set function (setter) as constexpr? [duplicate]
问题 This question already has answers here : What is the use of a constexpr on a non-const member function? (2 answers) Closed 12 months ago . I cannot understand the purpose of marking the setter function as constexpr , that is allowed since C++14. My misunderstanding comes from the next situation: I declare a class with a constexpr c-tor, and I am about to use it in a constexpr context, by creating a constexpr instance of that class constexpr Point p1 . An object p1 now is constant and its