When declaring a template you can choose either "class" or "typename" for a template parameter.
Example:
template<typename T> class vector { // ... };
or
The boost developers mailing list recently discussed the differences between reinterpret_cast<> and static_cast<> C++ casting operators.
The general consensus is that reinterpret_cast<> provides virtually no guarantees, does not have portable behavior and should only be used when you are trying to perform a cast that you should basically not be performing in the first place. The only legitimate use for reinterpret_cast<> seems to be converting between integral types and back, for instance, from a char * to an int and back to a char *.
static_cast<> should be used for virtually anything that dynamic_cast<> and const_cast<> cannot do.
Different compilers treat the two types of includes:
#include "filename"and
#include <filename>Differently in the details, but if you are programming for portability there is a simple rule of thumb to keep in mind: use the <> version to reference installed files, not local files.
We will illustrate the reasoning for using the #include "" format in your library's header files below.
myproject
src
project.cpp
include
Recent comments
2 days 20 hours ago
6 days 16 hours ago
6 days 16 hours ago
1 week 12 hours ago
1 week 5 days ago
1 week 5 days ago
2 weeks 5 days ago
10 weeks 20 hours ago
14 weeks 1 day ago
17 weeks 2 hours ago