Quantcast
Channel: Everyday I'm coding » c++11
Browsing all 10 articles
Browse latest View live

Are the days of passing const std::string & as a parameter over?

I heard a recent talk by Herb Sutter who suggested that the reasons to pass std::vector and std::string by const & are largely gone. He suggested that writing a function such as the following is...

View Article



Pretty-print C++ STL containers

Please take note of the updates at the end of this post. Update: I have created a public project on GitHub for this library! I would like to have a single template that once and for all takes care of...

View Article

Image may be NSFW.
Clik here to view.

What breaking changes are introduced in C++11?

I know that at least one of the changes in C++11 that will cause some old code to stop compiling: the introduction of explicit operator bool() in the standard library, replacing old instances of...

View Article

Why doesn’t C++ have a garbage collector?

I’m not asking this question because of the merits of garbage collection first of all. My main reason for asking this is that I do know that Bjarne Stroustrup has said that C++ will have a garbage...

View Article

Image may be NSFW.
Clik here to view.

What are Aggregates and PODs and how/why are they special?

This FAQ is about Aggregates and PODs and covers the following material: What are Aggregates? What are PODs (Plain Old Data)? How are they related? How and why are they special? What changes for C++11?...

View Article


Rule-of-Three becomes Rule-of-Five with C++11?

So, after watching this wonderful lecture on rvalue references, I thought that every class would benefit of such a “move constructor”, template<class T> MyClass(T&& other) edit and of...

View Article

Memory allocation of internal types used by the containers

C++11 standard has following lines in General Container Requirements. (23.2.1 – 3) For the components affected by this subclause that declare an allocator_type, objects stored in these components shall...

View Article

C11 grammar ambiguity between _Atomic type specifier and qualifier

I’m trying to write a lex/yacc grammar for C11 based off of N1570. Most of my grammar is copied verbatim from the informative syntax summary, but some yacc conflicts arose. I’ve managed to resolve all...

View Article


What exactly is nullptr?

We now have C++11 with many new features. An interesting and confusing one (at least for me) is the new nullptr. Well, no need anymore for the nasty macro NULL. int* x = nullptr; myclass* obj =...

View Article


How can I reliably get the address of an object?

Consider the following program: struct ghost { // ghosts like to pretend that they don't exist ghost* operator&() const volatile { return 0; } }; int main() { ghost clyde; ghost* clydes_address =...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images