Click here to Skip to main content
15,885,366 members

Comments by CubbiMew (Top 10 by date)

CubbiMew 25-Mar-15 22:11pm View    
So you're not actually looking for array rvalues? If I understood the actual problem, you just need to write a function template overload for std::initializer_lists, and have it call your pointer-taking function template with the result of calling begin on its parameter.
CubbiMew 7-Mar-15 14:59pm View    
I am not answering the question title, I am answering the question content.
CubbiMew 23-Jan-15 11:43am View    
No, it most certainly does not work as you described, except on a few very specific compiler/platform combinations (the ones I know of are the Windows runtime and the Solaris libc). Note that, with C, "works for me" is not an argument; writing past the end of an array might "work" too.

I filed a bug report against the linux man pages, by the way (the Linux fflush undoes the read buffering when reading a file (as required by POSIX), but does nothing when reading a terminal. The man page only mentions the file input)
CubbiMew 23-Jan-15 10:02am View    
No. #1 describes the library glibc as found on Linux and does not actually discuss fflush(stdin), which does exactly nothing on that platform. #3 describes Microsoft runtime, which, as I already mentioned, is about as useful as clrscr from conio.h.
CubbiMew 23-Jan-15 8:02am View    
#1 and #3 do not describe C. #2 incorrectly claims that the behavior for input streams is implementation-defined (it is actually undefined, the difference is significant), but at least it attempts to save face by mentioning this so-called flushing and adding "this is not portable expected behavior".