C++ Questions and Answers

Solve problems and approach solutions. Just ask and lurkers wi...
Feb 4, 2019 20:31
Essentially the issue is that if they do cause a problem, it's likely to be a slightly mindbogglingly confusing one. Whereas const variables are quite a bit simpler to diagnose.
 

Lounge<C++>

Today we're daydreaming about C++26 reflection
Oct 19, 2018 16:21
Regarding const int& foo, more or less you can split the variable declaration at the & or * symbol. Everything to the left can be in any order at all, anything to the right has a strict order.
Aug 21, 2018 16:28
Morwenn: Is there an updated pdf for ranges somewhere?
Mar 7, 2013 16:26
@Zoidberg o.O
Mar 7, 2013 07:15
I generally use stringstream... although recently I've been working on boost::spirit-infested projects, so some very convenient syntax comes along for the ride there.
Mar 7, 2013 07:13
str_end is a way of telling if you converted all of a string. You can check it againts the original string length to see if you have something dorky that you tried to convert like "3.14zimbabwe"
Mar 7, 2013 07:12
The functions sets the pointer pointed to by str_end to point to the character past the last character interpreted. If str_end is NULL, it is ignored.
Mar 7, 2013 07:06
@GamesBrainiac Each of the methods on that page have slightly different reactions when they don't work. Try playing around with them on codepad to get a feel for how they work.
Mar 7, 2013 07:04
@GamesBrainiac: I suspect you're looking for one of these stackoverflow.com/questions/1012571/…
Mar 7, 2013 07:00
@GamesBrainiac The same way python does if it's the first time you're checking... try to convert it and see if it fails. Exactly which method to use for converting depends on what kind of number you're expecting (and your personal religious beliefs)
Mar 7, 2013 05:44
(it was under discussion last time I looked)
Mar 7, 2013 05:44
@Rapptz 1, you mean... although I don't remember what the current standard says about NaN to the 0th power
Mar 7, 2013 05:44
@ThePhD quit using that retarded notation... you're hurting my embedded-programmer brain
Mar 7, 2013 05:39
@GamesBrainiac x^y is not "to the power of" in C++... it's a binary XOR operator
Mar 7, 2013 05:37
@GamesBrainiac What would it do?
Mar 7, 2013 05:37
@Rapptz constellation?
Mar 7, 2013 05:14
Anyone have any idea who does?
Mar 7, 2013 05:13
So... is this all an elaborate hoax that the people in this room put together?