15,891,375 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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".
CubbiMew
23-Jan-15 6:33am
View
Documentation for what exactly? If it claims to be documenting C, it is a lie. It is likely documenting some non-portable extension, like Microsoft's fflush, which is about as useful as clrscr.
CubbiMew
22-Jan-15 5:59am
View
No, where did you get this idea?
CubbiMew
15-Oct-14 0:07am
View
There is nothing special about array serialization, it just works: see
boost.serialization tutorial
[
^
]
Your code works pretty much as-is in GCC:
http://coliru.stacked-crooked.com/a/869d9f2a5a7d05c4
[
^
]
How exactly does it not work for you? Is there a compile-time error? Can you post it?
CubbiMew
14-Oct-14 20:23pm
View
Surely: std::equal(s.begin(), s.begin() + s.size()/2, s.rbegin())
CubbiMew
14-Oct-14 20:11pm
View
It's even sweeter if you realize that this loop can be done with a single call to std::equal
Show More