standards

If transactions over REST are unachievable, how can REST ever be really useful? [closed]

爱⌒轻易说出口 提交于 2019-11-29 19:09:01
When looking into REST one of the first things probably anybody will notice is there isn't any transaction semantics defined, some say this is implicitly against what REST is, whilst others say any attempt to do so would result in 'tainting' the REST systems. But lets say for arguments sake that REST did become a popular 'api' choice, and every site in the universe started to expose restful entry points. How exactly are these usable without transaction behavior (and I'm talking non compensating)? because it seems to me one of the benefits of REST is that it breaks down the components of data,

Where can I find a list of proper HTML nesting standards?

旧时模样 提交于 2019-11-29 18:52:19
I've been crawling Stack Overflow and the rest of the web, looking for proper nesting standards in regards to all HTML elements, but the search seems to be in vain. Which is why I am asking, where is there a reference of the proper nesting standards (such as the fact that you can't put <div> tags inside a <p> tag)? Try the language definition (hint: there are indexen of elements and attributes if you scroll down to the bottom) EDIT: there's also the latest draft of HTML5 unor In HTML5, each element has a list of categories it belongs to, and a content model . The content model describes (with

Can a “container_of” macro ever be strictly-conforming?

好久不见. 提交于 2019-11-29 17:25:50
问题 A commonly-used macro in the linux kernel (and other places) is container_of , which is (basically) defined as follows: #define container_of(ptr, type, member) (((type) *)((char *)(ptr) - offsetof((type), (member)))) Which basically allows recovery of a "parent" structure given a pointer to one of its members: struct foo { char ch; int bar; }; ... struct foo f = ... int *ptr = &f.bar; // 'ptr' points to the 'bar' member of 'struct foo' inside 'f' struct foo *g = container_of(ptr, struct foo,

Are identifiers starting with an underscore reserved according to the latest C++ standard? [duplicate]

孤街浪徒 提交于 2019-11-29 16:38:32
Possible Duplicate: What are the rules about using an underscore in a C++ identifier? I'm interested in the relevant sections from the standard (if any). Yes, when the underscore is followed by another underscore or an uppercase letter (i.e. for preprocessor #defines or macros), or if the identifier is in the global namespace (§17.6.4.3.2): Certain sets of names and function signatures are always reserved to the implementation: — Each name that contains a double underscore _ _ or begins with an underscore followed by an uppercase letter (2.12) is reserved to the implementation for any use. —

Why a variable can't be defined twice in 2 files in C

你说的曾经没有我的故事 提交于 2019-11-29 16:26:24
问题 Why can't I have int a; in 2 C files. I intend to combine both to make executable. I know from experience that I can't, but I want to find where the standard C99 says this and seal my understanding. I am reading ISO C99 standard from http://www.open-std.org/jtc1/sc22/wg...docs/n1256.pdf. It says on page 42: 6.2.2 Linkages of identifiers 1 An identifier declared in different scopes or in the same scope more than once can be made to refer to the same object or function by a process called linkage

What does the [Note] in undefined behavior paragraph in C++ standard mean?

六眼飞鱼酱① 提交于 2019-11-29 16:23:21
As user Tony points out there's a [Note] in paragraph 1.3.12 of C++ standard saying permissible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment... Doesn't this contradict the definition of UB saying that ...this International Standard imposes no requirements ? I mean they say "no requirements" and then say "permissible UB" - right in the same paragraph. How should this note be interpreted? Does it indeed limit UB in any way? From §6.5.1 of

How to explicitly call a namespace-qualified destructor?

孤者浪人 提交于 2019-11-29 16:09:15
问题 I am surprised that the following simple code won't compile (with gcc, version 4.8.1) #include <string> void test() { std::string* p = new std::string("Destruct me"); p->std::~string(); } It says: error: scope ‘std’ before ‘~’ is not a class-name. Yet reading the standard, I would say the syntax says it should be " postfix-expresssion -> pseudo-constructor-name ", where pseudo-constructor-name can be of the form " nested-name-specifier ~ type-name ", and nested-name-specifier can be "

Why do compilers give a warning about returning a reference to a local stack variable if it is undefined behaviour?

半城伤御伤魂 提交于 2019-11-29 16:08:59
问题 The C++ standard states that returning reference to a local variable (on the stack) is undefined behaviour, so why do many (if not all) of the current compilers only give a warning for doing so? struct A{ }; A& foo() { A a; return a; //gcc and VS2008 both give this a warning, but not a compiler error } Would it not be better if compilers give a error instead of warning for this code? Are there any great advantages to allowing this code to compile with just a warning? Please note that this is

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-29 15:17:56
问题 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

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

爷,独闯天下 提交于 2019-11-29 15:09:21
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . 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? 回答1: