cplusplus.co.il

Archive for October 2009

Checking sizeof or the offset of a member

Posted by: rmn on: 29/10/2009

Suppose we wanted to check the sizeof or the offset of a certain member within our struct (or class), without actually having an instantiated object to run the needed operations on. How would you do that?

Recent blog updates

Posted by: rmn on: 28/10/2009

I have spent quite a few hours during the last two days making thorough changes to this blog. One of those new updates is the change of the previous blog name, ”c++ talk” (at http://cpptalk.wordpress.com), to the new name “cplusplus.co.il” -  followed by the addition of a new domain name: http://cplusplus.co.il. However, it is important to note that the blog will remain [...]

I’ve finally had a little time to advance with reading Alexandrescu’s book on Modern C++ design, and I’m absolutely blown away by the sheer awesomeness of its ideas. I highly recommend getting this book! I would like to show just a little bit of what we can do with template specialization when it comes down [...]

Template template parameters

Posted by: rmn on: 19/10/2009

This is actually not a typo, I really meant to repeat the first word. Let’s see what template template parameters are..

Both std::cin and std::cout provide a conversion to a void* type, but not to a boolean: What use does a conversion to a boolean have, and which pitfalls does the current implementation save us from?

Subclassing templates

Posted by: rmn on: 09/10/2009

In this post I will introduce a common problem you are likely to bump into when inheriting from templated base classes.

Exception specifications

Posted by: rmn on: 06/10/2009

C++ provides a mechanism that allows any function to declare exactly which exception types it may throw, and these declerations are actually enforced in runtime. We will review exactly how this mechanism works, and why it is usually left unused.


Follow

Get every new post delivered to your Inbox.

Join 25 other followers