大约有 4,300 项符合查询结果(耗时:0.0375秒) [XML]
C++, Free-Store vs Heap
...he word "heap" in the context of dynamic allocation is used neither by the C++ standard nor C99 (I don't have C89 to which C++ refers, feel free to correct me if it uses the word). I couldn't find the date the GotW in question was published, but since it talks about the draft, it's obviously pre-sta...
Inheriting from a template class in c++
Let's say we have a template class Area , which has a member variable T area , a T getArea() and a void setArea(T) member functions.
...
How does the compilation/linking process work?
...
The compilation of a C++ program involves three steps:
Preprocessing: the preprocessor takes a C++ source code file and deals with the #includes, #defines and other preprocessor directives. The output of this step is a "pure" C++ file without p...
C++ - passing references to std::shared_ptr or boost::shared_ptr
...blem is that now the test code will exhibit undefined behaviour (in Visual C++ 2010 debug builds, it crashes).
Mr Maintainer is surprised by this, but adds a defensive check to send_message in an attempt to stop the problem happening:
void send_message(const std::shared_ptr<std::string> &...
How do you pass a function as a parameter in C?
...
Since C++11 you can use the functional library to do this in a succinct and generic fashion. The syntax is, e.g.,
std::function<bool (int)>
where bool is the return type here of a one-argument function whose first argument...
When to use reinterpret_cast?
... interpreted at compile time hence the word static . This is the cast the C++ compiler uses internally for implicit casts also.
...
Array or List in Java. Which is faster?
...
I'm guessing the original poster is coming from a C++/STL background which is causing some confusion. In C++ std::list is a doubly linked list.
In Java [java.util.]List is an implementation-free interface (pure abstract class in C++ terms). List can be a doubly linked list ...
Is null reference possible?
...
@Default Standards in the [c++] tags should be high. My answer sounded like both acts were one and the same thing :) While dereferencing and getting an lvalue you don't pass around that refers to "no object" could be feasibly, storing it into a referen...
Why are arrays of references illegal?
...
Answering to your question about standard I can cite the C++ Standard §8.3.2/4:
There shall be no references to references, no arrays of references, and no pointers to references.
share
|
...
Where do I find the definition of size_t?
...
Please refer to ISO C(99) standard (from which the C++ standard includes) sections 7.17 and 7.18.3
– Martin York
Jul 13 '09 at 16:50
3
...