How to explicitly call a namespace-qualified destructor?

In the standard, at: ยง3.4.5/3 If the unqualified-id is ~type-name, the type-name is looked up in the context of the entire postfix-expression. therefore it would seem that ~string should be looked up in the context of the std:: namespace. In fact, considering that a corresponding home-made version works as follows on both GCC and Clang: … Read more

Why is sizeof(bool) not defined to be one by the C++ standard?

The other likely size for it is that of int, being the “efficient” integer type for the platform. On architectures where it makes any difference whether the implementation chooses 1 or sizeof(int) there could be a trade-off between size (but if you’re happy to waste 7 bits per bool, why shouldn’t you be happy to … Read more

What are RFC’s?

The term comes from the days of ARPANET, the predecessor to the internet, where the researchers would basically just throw ideas out there to, well, make a request for comments from the other researchers on the project. They could be about pretty much anything and were not very formal at the time. If you go … Read more

Why does ISO/IEC charge for the C and C++ standards instead of providing them for free?

For what it’s worth, Herb Sutter wrote an article touching on this issue, and there’s a fair bit of discussion in the comments: http://herbsutter.com/2010/03/03/where-can-you-get-the-iso-c-standard-and-what-does-open-standard-mean/ As he mentions, “open” does not necessarily mean “no-cost”. As far as students or others with limited financial means who might want free versions of thee documents, note that: many references … Read more

Bit manipulations good practices

The problem with bit fields is that the C standard does not dictate that the order in which they are defined is the same as the order that they are implemented. So you may not be setting the bits you think you are. Section 6.7.2.1p11 of the C standard states: An implementation may allocate any … Read more

Are constant C expressions evaluated at compile time or at runtime?

Macros are simply textual substitution, so in your example writing TIMER_100_MS in a program is a fancy way of writing 32768 / 10. Therefore, the question is when the compiler would evaluate 32768 / 10, which is a constant integral expression. I don’t think the standard requires any particular behavior here (since run-time and compile-time … Read more

What’s the best “file format” for saving complete web pages (images, etc.) in a single archive? [closed]

My favourite is the ZIP format. Because: It is very well sutied for the purpose It is well documented There a a lot of implementations available for creating or reading them A user can easily extract single files, change them and put them back in the archive Almost every major Operating System (Windows, Mac and … Read more

Why do const references extend the lifetime of rvalues?

It was proposed in 1993. Its purpose was to eliminate the inconsistent handling of temporaries when bound to references. Back then, there was no such thing as RVO (return value optimization), so simply banning the binding of a temporary to a reference would have been a performance hit. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1993/N0345.pdf

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)