constants
What are most graceful alternatives to constant interfaces?
I had been looking at some code developed by an off-shore group. I see at least one \"constant interface\" per module defined.[详细]
2023-04-05 09:02 分类:问答Is there a way to tell openmp that shared data is constant?
I am guessing that even reading from shared data in openmp causes some parallel overheads, as depending on processor architecture (if different cores have their own cache...) it may be necessary to re[详细]
2023-04-05 08:23 分类:问答What happens if you return a non-static local when the return type is static const
If you have the following function: 开发者_StackOverflow中文版static const map<ushort, ulong> MakeMap()[详细]
2023-04-05 07:37 分类:问答Which data structure to use for huge but constant dictionary in C++
I have to use a huge dictionary with integer (or enum) keys and string values. But this is totally constant. No way to change in runtime. Is there a way (using templates etc.) to retrieve dictionary d[详细]
2023-04-05 07:17 分类:问答UnitTest++ issues: Trying to use a Predicate that has state
Relevant code, this is from UnitTest++/TestRunner.h: class TestRunner { public: explicit TestRunner(TestReporter& reporter);[详细]
2023-04-05 00:32 分类:问答Should I use const to make objects thread-safe?
I wrote a class which instances may be accessed by several threads. I used a trick to remember users they have to lock the object before using it. It involves keeping only const instances. When in the[详细]
2023-04-04 18:08 分类:问答What is a constant reference? (not a reference to a constant)
Why do constant references not behave the same way as constant pointers, so that I can actually change the object they are pointing to? They really seem like another plain variable declaration. Why wo[详细]
2023-04-04 17:23 分类:问答Using decltype to cast this to const
I\'m attempting to solve a problem in which decltype will greatly simplify things, but I\'m running into an issue using decltype on *this and adding a const qualifier. The sample code below demonstrat[详细]
2023-04-04 15:27 分类:问答Question about 'const' functions, c++
I understand that when I declare a membe开发者_C百科r function as const I actually say that I will not change the class. My question - does \'class\' refer to (*)this instance or to the class in gener[详细]
2023-04-04 11:48 分类:问答Warning for const in typedef
When I was compiling a C++ program using icc 11, it gave this warning: warning #21: type qualifiers are meaningless in this declaration[详细]
2023-04-04 07:34 分类:问答
加载中,请稍侯......