standards

Which C++ draft?

萝らか妹 提交于 2019-12-12 08:56:02
问题 I am interested in having a current C++ standard and I am a little bit confused with links at http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/. What is supposed to be the new version? What title should I look for? Is it " Working Draft, Standard for Programming Language C++ " or " Programming Languages — C++ "? What's the difference between these papers? Why N4141 paper is password-protected while newer N4296 is not? In question Where do I find the current C or C++ standard documents?

Is there a “canonical” name for a function combining min() and max()?

℡╲_俬逩灬. 提交于 2019-12-12 08:18:27
问题 I find that I frequently end up writing a function that I always call " clamp() ", that is kind of a combination of min() and max() . Is there a standard, "canonical" name for this function? It always looks something like this: function clamp($val, $lower, $upper) { if ($val < $lower) return $lower; else if ($val > $upper) return $upper; else return $val; } Or simply using built-in min() and max() functions: function clamp($val, $lower, $upper) { return max($lower, min($upper, $val)); }

HTML version of C standard draft (n1256.pdf)?

独自空忆成欢 提交于 2019-12-12 07:44:32
问题 Is there an HTML version of n1256.pdf (ISO C99+TC3), or a recommended way to convert it to html or another less-painful format for browsing? All of the pdf converters I've tried have given very poor results, especially in failing to convert the "fi" ligatures to something more easily searchable, but also just with respect to basic formatting. Here is the original for reference: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 回答1: It seems to be the last draft prior to

locale Facet Constructor Ignored

人盡茶涼 提交于 2019-12-12 07:27:13
问题 The locale Facet constructor: Constructs a copy of other except for the facet of type Facet (typically deduced from the type of the argument) which is installed from the argument facet. If facet is NULL, the constructed locale is a full copy of other. The locale constructed in this manner has no name. I try to construct using my Facet here, but when I put a break-point in my do_decimal_point and do_thousands_sep they are never called :( I can see the Facet being passed in, but it's passed

What's the deal with the banner command?

*爱你&永不变心* 提交于 2019-12-12 07:08:56
问题 In some versions of UNIX and Linux there's a banner command (usually /usr/bin/banner) that prints great output like this: ##### ####### # ##### # # # # # # # # # # # # # # # # # # ##### # # # # ### # # ####### # # # # # # # # # # # # ##### # # # ##### # # In other versions, the banner command (frequently /usr/games/banner) prints an ENORMOUS banner like you'd make in 1980 with Printshop that are suited for use at birthday parties and stuff. I tend to love using banner for my scripts but it

Does the standard require EOF to be negative?

二次信任 提交于 2019-12-12 05:14:09
问题 Is it written in the standard that EOF must be negative? On the contrary, WEOF is not required to be negative. Why? The situation for wchar_t must not be in any way different from ordinary char (except where automatic promotion from char to int plays the role), because defining wchar_t as char is perfectly fine with the standard. Therefore, similar rules must apply. Some quotations from glibc reference: if wchar_t is defined as char the type wint_t must be defined as int due to the parameter

Order of evaluation in C++ function parameters

╄→гoц情女王★ 提交于 2019-12-12 04:47:08
问题 If we have three functions (foo, bar, and baz) that are composed like so... foo(bar(), baz()) Is there any guarantee by the C++ standard that bar will be evaluated before baz? 回答1: No, there's no such guarantee. It's unspecified according to the C++ standard. Bjarne Stroustrup also says it explicitly in "The C++ Programming Language" 3rd edition section 6.2.2, with some reasoning: Better code can be generated in the absence of restrictions on expression evaluation order Although technically

C++11 standard document costs

六眼飞鱼酱① 提交于 2019-12-12 04:19:39
问题 Why are there different PDF versions of the ISO/IEC 14882:2011 standard (C++11), which cost from $30 to $761? (see http://webstore.ansi.org or any other distributor) btw.: Has the INCITS $30 version just been published? It's available at the ANSI web store, but not at the INCITS web store.. 回答1: It's just the way the standards organizations work. They're not competing with each other to get your business. You can basically get the C++11 standard for free anyway. See n3337 here. It's the

WebLogic: Getting Standard Error Into A File

拟墨画扇 提交于 2019-12-12 02:44:42
问题 I'm using WebLogic 9.2. I found an option in the Admin Server web page to send standard out to the server log files. I would like the same for standard error, but I can't find an option for it in the Admin Server web page. I haven't found Oracles documentation very clear. Do I need to set this option by hand in a config file somewhere and if so where and how? Thanks in advance 回答1: If you are using 'RedirectStdoutToServerLogEnabled' feature as described in http://download.oracle.com/docs/cd

Strict Standards: Only variables should be passed by reference in..

≡放荡痞女 提交于 2019-12-11 20:15:26
问题 I am receiving an error when I attempt to upload an image. The image is always uploaded, but after every upload I receive this error: Strict Standards: Only variables should be passed by reference in /filemanager/afmlib.php on line 57 Line 57 in my filemanager is: function AFM_fileExt($filename) { return strtolower(end(explode('.', $filename)));////THIS IS LINE: 57 } How can I fix this? 回答1: Why not let PHP do the work: function AFM_fileExt($filename) { return strtolower(pathinfo($filename,