standards

Why does INVOKE facility in the C++11 standard refer to data members?

微笑、不失礼 提交于 2019-11-29 10:42:53
$ 20.8.2 of the standard describes the INVOKE facility that is mostly used to describe how callables are called with variadic argument lists throughout the standard library: Define INVOKE (f, t1, t2, ..., tN) as follows: — (t1.*f)(t2, ..., tN) when f is a pointer to a member function of a class T and t1 is an object of type T or a reference to an object of type T or a reference to an object of a type derived from T; — ((*t1).*f)(t2, ..., tN) when f is a pointer to a member function of a class T and t1 is not one of the types described in the previous item; — t1.*f when N == 1 and f is a

Vertical alignment of empty inline-block elements

ぃ、小莉子 提交于 2019-11-29 10:28:15
Consider the following html/css: <style> span { display:inline-block; width:5em; height:5em; padding:1em; } </style> a <span style="background-color:blue;">b</span> <span style="background-color:green;"></span> <span style="background-color:red;">c</span> d The blue and red boxes, plus the text both inside and surrounding the boxes lines up horizontally. The empty green box does not; it appears above the other two boxes. If I add some text to the green box, this behavior stops and everything lines up the way I want it to. This happens consistently in IE8 (standards mode), FireFox 3.0 and

Image map support in firefox, chrome and other browsers

二次信任 提交于 2019-11-29 10:16:06
Are image maps supported in chrome and firefox? w3schools seems to suggest they are . Given this, why would the following HTML fail? (Image is displayed but no links work - It does work correctly in IE) <img src="Images/backgroundFinal.png" usemap="#mainImageMap" alt="MainBackground" style="border: none;" /> <map id="mainImageMap"> <area shape="rect" alt="Home Page" title="Home Page" coords="309,198,413,223" href="Default.aspx" target="" /> <area shape="rect" alt="About me" title="About me" coords="245,334,319,353" href="About.aspx" target="" /> <area shape="rect" alt="Gallery" title="Gallery"

Converting a non-`void` pointer to `uintptr_t` and vice-versa

送分小仙女□ 提交于 2019-11-29 09:21:46
There are two related C standard rules: C99 standard, 6.3.2.3 : A pointer to void may be converted to or from a pointer to any incomplete or object type. A pointer to any incomplete or object type may be converted to a pointer to void and back again; the result shall compare equal to the original pointer. And 7.20.1.4 : The following type designates an unsigned integer type with the property that any valid pointer to void can be converted to this type, then converted back to pointer to void, and the result will compare equal to the original pointer: uintptr_t It means, that the following code

Is it okay to use “and”, “or” etc. instead of “&&”, “||”?

北城余情 提交于 2019-11-29 09:06:40
I'm used to the and and or keywords in C++. I've always used them and typing them is fast and comfortable for me. Once I've heard that these aliases are non-standard and may not work on all compilers. But I'm not sure of it, I don't really know if it's true. Let's assume that I give someone my code, will he have problems compiling it? Is it all right when I use and , or instead of && , || ? Or are these keywords really non-standard? P.S.I use the MinGW compiler. In silico They are in fact standard in C++, as defined by the ISO 14882:2003 C++ standard 2.5/2 (and, indeed, as defined by the 1998

Lat Long or Long Lat

时光毁灭记忆、已成空白 提交于 2019-11-29 09:02:56
There seems to be no standard whether Longitude,Latitude or Latitude,Longitude should be used. WSG84 and stuff based directly on it, seem to prefer Long,Lat. "Normal people" always tend to speak of Lat, Long - so I've very often seen code or frameworks that use Lat, Long (e.g. google Maps) Is there any strong argument for either way? You are correct, there is no standard on the order: In mathematical functions which do an universal conversion, between x,y or lon,lat or inverse, the lon,lat order should be used, because the x-axis relates to longitude and y to latitude and the x,y order is

What is the point of `void func() throw(type)`?

狂风中的少年 提交于 2019-11-29 08:08:47
I know this is a valid c++ program. What is the point of the throw in the function declarement? AFAIK it does nothing and isnt used for anything. #include <exception> void func() throw(std::exception) { } int main() { return 0; } That is an exception specification, and it is almost certainly a bad idea . It states that func may throw a std::exception , and any other exception that func emits will result in a call to unexpected() . It specifies that any std::exception can be thrown from func() , and nothing else. If something else is thrown, it will call an unexpected() function which by

What are RFC's?

落花浮王杯 提交于 2019-11-29 06:24:01
问题 I think there are a lot of people out there unaware of RFC's (Request for Comments). I know what they are at a logical level, but can anybody give a good description for a new developer? Also, sharing some resources on how to use and read them would be nice. 回答1: 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

Do C99 signed integer types defined in stdint.h exhibit well-defined behaviour in case of an overflow?

时光怂恿深爱的人放手 提交于 2019-11-29 06:20:38
All operations on "standard" signed integer types in C (short, int, long, etc) exhibit undefined behaviour if they yield a result outside of the [TYPE_MIN, TYPE_MAX] interval (where TYPE_MIN, TYPE_MAX are the minimum and the maximum integer value respectively. that can be stored by the specific integer type. According to the C99 standard, however, all intN_t types are required to have a two's complement representation: 7.8.11.1 Exact-width integer types 1. The typedef name intN_t designates a signed integer type with width N , no padding bits, and a two’s complement representation. Thus, int8

Standard UML file format

谁说胖子不能爱 提交于 2019-11-29 06:15:48
问题 I have designed UML diagrams in different tools (StarUML, BoUML, Papyrus, Omondo, Rational Rose, etc.) depending on the project and the date (rose was first, after Omondo, then starUMl, ..., now papyrus). However, I see that I cannot open my old UML diagrams because the tool is obsolete. I would like to know if there is a standard format for UML diagrams. Probably not in production, but at least to know if there is proposal of standard format. Probably, Eclipse is doing something like that