standards

How and why did the ISO C++ Standards Committee (WG21) decide to accept the proposal for a spaceship operator as it is? [closed]

核能气质少年 提交于 2019-11-30 10:15:28
In a recently published paper [1], Herb Sutter et al. describe an extension of the programming language C++ by a three way comparison operator. The authors refer to a considerable number of earlier proposals, all of which were ultimately rejected. The clever core concept of the new approach is to encode different categories of relations in the return type of the comparison operator. The authors declare that The primary design goal is conceptual integrity [Brooks 1975], which means that the design is coherent and reliably does what the user expects it to do. A total of five categories of

Will pthreads become obsolete once std:thread makes into C++Ox [closed]

心已入冬 提交于 2019-11-30 09:56:47
Obviously we will still maintain it, but how useful will it be, once the C++ standard guarantees is. What about synchronization primitives (Mutex, conditional variables) with advent of the new standard? Do you consider pthread harder to master as opposed to std::thread? C isn't going away. POSIX isn't going away. Multithreaded code written in C for POSIX isn't going away. So pthreads isn't going away. Many implementations of std::thread will use pthreads under the hood. "The Pthreads API is defined in the ANSI/IEEE POSIX 1003.1 - 1995 standard." -- POSIX Threads Programming https://computing

Potential problem with C standard malloc'ing chars

我是研究僧i 提交于 2019-11-30 09:32:44
When answering a comment to another answer of mine here , I found what I think may be a hole in the C standard (c1x, I haven't checked the earlier ones and yes, I know it's incredibly unlikely that I alone among all the planet's inhabitants have found a bug in the standard). Information follows: Section 6.5.3.4 ("The sizeof operator") para 2 states "The sizeof operator yields the size (in bytes) of its operand" . Para 3 of that section states: "When applied to an operand that has type char, unsigned char, or signed char, (or a qualified version thereof) the result is 1" . Section 7.20.3.3

std::allocator construct/destroy vs. placement new/p->~T()

强颜欢笑 提交于 2019-11-30 09:17:40
For a project of mine, I am writing some STL containers from scratch (I have my reasons). Since I am mimicking the functionality and interfaces of the STL so closely I am doing my best to keep with the policy "if it has the same name as a standard construct, it will conform to the standard as much as possible." So, of course my containers take allocators as a template parameter, which is very nice as it allows for some custom allocation schemes. On to my question. The std::allocator interface separates memory allocation from object construction. Likewise it separates deallocation from

JavaFX Menu - first letter, underline decoration

删除回忆录丶 提交于 2019-11-30 08:46:25
Following the UI standards: If application menu item (on the top menu bar) opens a dropdown, it MUST be decorated as it is shown under: The first letter has "text-decoration:underline" property. But accoring to this http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html I can't do like that in in javafx app. Any suggestions? jewelsea Background on Mnemonics What you point to in your image is a keyboard mnemonic . JavaFX does support mnemonics, but you will only see them on platforms which natively use mnemonics and where you have programmed your application to use mnemonics.

Class component order of initialisation

对着背影说爱祢 提交于 2019-11-30 08:26:59
问题 class D: A { B obj; C obj2; } What order of construction here is guaranteed ? I know that D will be constructed after A, B and C, but what I really want to know is whether A is guaranteed to be constructed before B or C, or even whether B is guaranteed to be constructed before C. I know you can have an explicit initialiser list: D(): A(), B(), C() {} but does that initialiser list determine the order of initialisation? Also, does whether or not any of the components do or don't have a default

Strict aliasing and memory locations

你。 提交于 2019-11-30 06:44:53
Strict aliasing prevents us from accessing the same memory location using an incompatible type. int* i = malloc( sizeof( int ) ) ; //assuming sizeof( int ) >= sizeof( float ) *i = 123 ; float* f = ( float* )i ; *f = 3.14f ; this would be illegal according to C standard, because the compiler "knows" that int cannot accessed by a float lvalue. What if I use that pointer to point to correct memory, like this: int* i = malloc( sizeof( int ) + sizeof( float ) + MAX_PAD ) ; *i = 456 ; First I allocate memory for int , float and the last part is memory which will allow float to be stored on aligned

Standard UML file format

早过忘川 提交于 2019-11-30 06:39:45
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 with the M2 project, but do the other tools (not eclipse based) are interested in reading this format.?

Is C++03 a new version of the C++ Standard or just a Technical Corrigendum (TC) of C++98?

痴心易碎 提交于 2019-11-30 06:34:26
I'm pretty sure I read on an authoritative source somewhere (I believe it was on the WG21 pages) that C++03 was not a technical corrigendum of C++98 but that it was a new release of the C++ Standard. But nontheless I see only -std=c++98 switch in GCC and others compilers and Alf P Steinbach made a few comments hinting at that it may indeed be a TC of C++98. So when I'm writing about "C++03", does it suffice mentioning C++98? As a related question, is it even wrong to use the term "C++03"? Because I think if it is really C++98 TC1, then it seems to me it cannot be called C++03. Just as I've

Is there a de facto or established reason why multipart HTTP responses aren't generally supported in browsers?

蓝咒 提交于 2019-11-30 06:24:19
The HTTP protocol has supported multipart responses for a long time. I've used them before for APIs with appropriately equipped consumers, but it doesn't appear browser support for them is very good, nor has it improved in the last half-decade. I've had difficulty finding much information on why this might be. I'd love to be able to cut down on HTTP requests by sending all of the assets I know a webapp will need on the initial request, especially for apps that employ client-side frameworks like Backbone.js. Are there any white-papers, trade articles, failed experiments, or other evidence on