standards

Name database design notation you prefer and why?

走远了吗. 提交于 2019-11-26 09:34:27
问题 Which notation , methodology and tools for database designing, modeling, diagraming you prefer and why? Which notation, standards , methodology are the most broadly used and covered by different vendors? Which are standard and which are not ? i.e. which are to stick with and which to avoid And personal question to PerformaneDBA: Why do you prefer IDEF1X? Is not it more comfortable to stick with tools, notations built-in into used client tools of RDBMS? Update: I just read What are some of

Is a C++ preprocessor identical to a C preprocessor?

↘锁芯ラ 提交于 2019-11-26 08:25:33
问题 I am wondering how different the preprocessors for C++ and C are. The reason for the question is this question on a preprocessor-specific question where the paragraph of the standard that addresses the question has a different wording (and a different paragraph number) and also are difference concerning the true and false keywords in C++. So, are there more differences or is this the only difference. An extension of the question would be when is a source file emitted differently by a C++

Bitshift and integer promotion?

旧时模样 提交于 2019-11-26 08:23:00
问题 Normally, C requires that a binary operator\'s operands are promoted to the type of the higher-ranking operand. This can be exploited to avoid filling code with verbose casts, for example: if (x-48U<10) ... y = x+0ULL << 40; etc. However, I\'ve found that, at least with gcc, this behavior does not work for bitshifts. I.e. int x = 1; unsigned long long y = x << 32ULL; I would expect the type of the right-hand operand to cause the left-hand operand to be promoted to unsigned long long so that

Preparation for std::iterator Being Deprecated

[亡魂溺海] 提交于 2019-11-26 08:04:46
问题 On March 21 st the standards committee voted to approve the deprecation of std::iterator proposed in P0174: The long sequence of void arguments is much less clear to the reader than simply providing the expected typedef s in the class definition itself, which is the approach taken by the current working draft, following the pattern set in c++14 Before c++17 inheritance from std::iterator was encouraged to remove the tedium from iterator boilerplate implementation. But the deprecation will

Why an unnamed namespace is a “superior” alternative to static? [duplicate]

丶灬走出姿态 提交于 2019-11-26 07:53:50
问题 This question already has answers here : Superiority of unnamed namespace over static? (3 answers) Closed 6 years ago . The section $7.3.1.1/2 from the C++ Standard reads: The use of the static keyword is deprecated when declaring objects in a namespace scope; the unnamed-namespace provides a superior alternative. I don\'t understand why an unnamed namespace is considered a superior alternative? What is the rationale? I\'ve known for a long time as to what the standard says, but I\'ve never

Is it legal to redefine a C++ keyword?

自作多情 提交于 2019-11-26 07:46:10
问题 In this article from Guru of the week, it is said: It is illegal to #define a reserved word. Is this true? I can’t find anything in the norm, and I have already seen programmers redefining new, for instance. 回答1: 17.4.3.1.1 Macro names [lib.macro.names] 1 Each name defined as a macro in a header is reserved to the implementation for any use if the translation unit includes the header.164) 2 A translation unit that includes a header shall not contain any macros that define names declared or

Standard Library Containers with additional optional template parameters?

喜你入骨 提交于 2019-11-26 07:43:23
问题 Having read the claim multiple times in articles - I want to add this question to Stackoverflow, and ask the community - is the following code portable? template<template<typename T, typename Alloc> class C> void f() { /* some code goes here ... */ } int main() { f<std::vector>(); } Is the implementation that supplies std::vector really allowed to have additional, defaulted template parameters beyond the two well known ones? This would render the above code ill-formed, as it assumes two

Declare main prototype

随声附和 提交于 2019-11-26 06:49:27
问题 Is there any reason why I never see main\'s prototype declared in C programs, ie: int main(int argc, char* argv[]); int main(int argc, char* argv[]) { return 0; } Always seemed inconsistent.. 回答1: C language standard, draft n1256: 5.1.2.2.1 Program startup 1 The function called at program startup is named main . The implementation declares no prototype for this function . It shall be defined with a return type of int and with no parameters: int main(void) { /* ... */ } or with two parameters

std::vector and contiguous memory of multidimensional arrays

為{幸葍}努か 提交于 2019-11-26 06:47:13
问题 I know that the standard does not force std::vector to allocate contiguous memory blocks, but all implementations obey this nevertheless. Suppose I wish to create a vector of a multidimensional, static array. Consider 2 dimensions for simplicity, and a vector of length N. That is I wish to create a vector with N elements of, say, int[5] . Can I be certain that all N*5 integers are now contiguous in memory? So that I in principle could access all of the integers simply by knowing the address

How to determine the version of the C++ standard used by the compiler?

北城以北 提交于 2019-11-26 06:43:54
How do you determine what version of the C++ standard is implemented by your compiler? As far as I know, below are the standards I've known: C++03 C++98 By my knowledge there is no overall way to do this. If you look at the headers of cross platform/multiple compiler supporting libraries you'll always find a lot of defines that use compiler specific constructs to determine such things: /*Define Microsoft Visual C++ .NET (32-bit) compiler */ #if (defined(_M_IX86) && defined(_MSC_VER) && (_MSC_VER >= 1300) ... #endif /*Define Borland 5.0 C++ (16-bit) compiler */ #if defined(__BORLANDC__) &&