decltype is a type specifier introduced in C++11. It behaves like a function that evaluates to the type of an object at compile time. This article is helping provide some more background information necessary for the more meatier C++11 articles to come.
decltype(4.23 * 5) v = 4.23*5;
In this example, the compiler is determining for us what the type of 4.23 * 5 would be and then giving that type to v.
With some help from typeid we can see that the type assigned by the compiler is double.
In this article we are going to introduce the concept of C++ Template Partial Specialization. This is meant to be just a primer on the topic and not exhaustive. The examples here will be used and referenced in later articles. A series of discussions about C++11, now that the language has been finalized, will be coming shortly.
In C++ a template class such as this:
template<typename LHS, typename RHS> struct Add_With_Magic { static int go(const LHS &t_lhs, const RHS &t_rhs) {
I just spent the better part of the day debugging an insidious little bug. It really shouldn't have taken that long... I even had unit tests in place that covered the code in question! Right!?
The fact is, C++ is a complex language and getting every detail right all the time can be hard. In this case I had a simple class with a boost::shared_ptr in it. In the copy constructor I wanted to clone the pointed to object, but needed to keep the pointer for other house keeping reasons.
class MyClass { public: MyClass(const MyClass &t_other)
Microsoft recently posted a video on Channel 9 and their blogs describing the upcoming work they have planned for C++.
The abstract of the video tries to point out Microsoft's unfailing devotion to C++ development:
Considering the number of articles and polls we come across asking if C++ is dying or dead combined with the decrease in C++ job posting I have personally noticed, C++ sure is alive and well in the AI frontier.
C++ takes or ties the top 27 places at the 2010 Google AI Challenge
In the context of the rest of the Nobody Understands C++ series, I feel like this one is redundant. But it seems like it needs to be said.
C++ is not an object oriented programming language. C++ is a multi-paradigm language that supports most of the major programming paradigms that have been widely accepted.
Specifically, C++ supports:
Recent comments
2 days 12 hours ago
2 days 12 hours ago
3 days 8 hours ago
1 week 1 day ago
1 week 1 day ago
2 weeks 23 hours ago
9 weeks 3 days ago
13 weeks 4 days ago
16 weeks 2 days ago
16 weeks 4 days ago