const-correctness
Is it worth to insert `const`-correctness
I\'m currently confronted with a C++ project written by some senior programmers consi开发者_运维知识库sting of about 400 files and 200 classes.[详细]
2023-04-09 11:41 分类:问答Trailing return types, decltype and const-ness
I was merily experimenting with the new trailing return types, where I hit a problem with this (simplified) code[详细]
2023-04-01 17:38 分类:问答macro solution for duplicate, const and non-const, getters?
Can this solution be turned into a macro so that I call something along the lines of: CALL_CONST_FUNC(objToReturn, thisPtr)->SomeConstFunc();[详细]
2023-03-27 09:54 分类:问答const-correctness and the safe bool idiom
I have another question related to the safe bool idiom: typedef void (Testable::*bool_type)() const;// const necessary?[详细]
2023-03-27 04:11 分类:问答Accessor function taking a const arg but returning non const pointer in C
seeking some advice here. I have a structure which contains a pointer to another struct开发者_StackOverflow中文版ure, something like this:[详细]
2023-03-23 07:57 分类:问答implementing a variadic zip function with const-correctness
I\'m trying to implement a zip function.zip\'s parameters are each wrapped<Ti>, where Ti varies from parameter to parameter.[详细]
2023-03-18 21:16 分类:问答Qt - QList const correctness
A QList<T *> can\'t easily be const-correct. Consider the function void f(QList<T *> list)[详细]
2023-03-15 22:58 分类:问答is it good practice to add const at end of member functions - where appropriate?
Is it a good practice, in C++, to add const at t开发者_StackOverflow社区he end of a member function definition every time the function does not modify the object, i.e., every time the function is \'el[详细]
2023-03-02 00:56 分类:问答Cornered by const: std::map::find() const overload
Consider the following snippet: #include <map> class C { public: C() {} const int& f(const int& x) const[详细]
2023-03-01 15:22 分类:问答Should I declare any method that can be const a const method
Simple question. Should I declare any method that can be const a const method? This includes methods that don\'t 开发者_C百科return any member variables, or return const references to member variables[详细]
2023-02-26 06:32 分类:问答