« first day (1107 days earlier)      last day (3844 days later) » 

12:00 AM
Jun 5 at 3:01, by Rapptz
I also don't know why you guys dislike iterators.
begins from here
 
user1804599
@Rapptz dat pun
 
@FredOverflow I'd like to have a slight, non-confrontational disagreement with your first statement.
 
and then when I went to look up what a range is, pairing the begin/end iterators into its own range class is dumb so :|
meh, best to forget about ranges existing for me I guess
no one's even sure what the hell a range even is.
everyone's always spouting their own ideas so that's annoying too
 
[a, b) - this is a range.
 
@Rapptz I'd like to know why it's dumb.
 
12:02 AM
@EtiennedeMartel Me too.
 
@Abyx The c++ syntax of the [a, b) range is the goes to operator b-->a.
 
To be honest I never got the answer but apparently it's bad design for a range class.
 
But the main issue with iterators is that they're useless on their own.
@Rapptz Well, you can construct a range from two iterators, but a range isn't a pair of iterators.
 
@CaptainGiraffe I'd like to have a slight, non-confrontational disagreement with that statement.
 
Like I said, I don't know what constitutes as "good range design" because when I looked it up everyone had their own ideas
I liked (and others in here do too) D's ranges but I'm not sure how to implement those myself.
 
12:05 AM
In my head, a good range design is .NET's IEnumerable.
In unrelated news, I added something to my Steam recommendations.
 
@sehe iterators can be selected upon properties/tags, pointers is a raw type.
 
@EtiennedeMartel The Stanley Parable? I watched a review, looks neat
 
@Borgleader Then you've been spoiled.
Nooooo.
 
I'll wait till i forget the review to play it :P
 
user1804599
> I love this game more than my parents.
 
user1804599
12:09 AM
Still says nothing. :D
 
The comments are mostly space fillers. If a game is in my recommendations, you should play it (unless you're @Rapptz or @DeadMG, because we've already established are different our tastes in games are).
 
I only have two games in my steam recommendation thing
 
user1804599
I have zero.
 
Torchlight 2 and Cave Story
 
@CaptainGiraffe kindly check the reply-to subject message
@CaptainGiraffe also, pointers are a valid model of an iterator. You may dislike them, but that's not very relevant
 
12:12 AM
they kept the dumb syntax and casing :|
 
0
Q: Why std::next does not accept InputIterator?

Evgeny PanasyukISO C++11 24.3: template <class InputIterator, class Distance> void advance(InputIterator& i, Distance n); // ... template <class ForwardIterator> ForwardIterator next ( ForwardIterator x, typename std::iterator_traits<ForwardIterator>::difference_type n = 1 ); Why std::next does not a...

 
user1804599
@Rapptz Foo_bar is so fucking beautiful.
 
It's awful
 
@sehe D'oh. Yes of course pointers works as iterators. I love them just as much as my other children.
 
and they kept the dumb terse syntax
Mergable{It1, It2, Out}
Out merge(It1 first1, It1 first2, It2 second1, It2 second2, Out output) {...}
 
12:17 AM
@Rapptz Looks good
 
Man Concepts Lite really sucks.
 
user1804599
template<glob(Mergable {It1,It2,Out}, ",")> :D
 
@EvgenyPanasyuk not really, kinda retarded though they made it a bit better.
 
Xeo
@EvgenyPanasyuk bullshit
 
12:19 AM
@Xeo I am looking to ISO to clarify, because I don't know if that is true. I thought it is not requirement.
 
is there no hope of removing Dumb_case?
 
Xeo
@Rapptz The terse syntax is okay-ish
 
user1804599
@Rapptz I actually like it.
 
@Xeo yeah, of course - std::advance does not dereference it
 
Such code can be used in generic functions which work on all iterators starting from InputIterator. I am interested to hear objective reasons. — Evgeny Panasyuk 5 mins ago
@EvgenyPanasyuk excellent point. However, that doesn't make my argument "subjective" :/
 
Xeo
12:21 AM
@EvgenyPanasyuk It can also advance the iterator multiple times
 
@Xeo as well as std::next(it, multiple_times)
@sehe I mean objective reasons about DR wording, which is not clear for me.
 
user1804599
I need anal shower.
3
 
@EvgenyPanasyuk ah
 
@sehe safety is semi-objective here :P
 
@CaptainGiraffe Show me a pointer that is not an iterator :) Even if you have a pointer to a single int, it is still legal to increment it once.
 
12:25 AM
hello. In c what does 0LL in long long max = 0LL; do?
 
zch
@FredOverflow void*
 
It means that the literal is a long long.
 
@LearningC LL denotes a long long literal.
 
Xeo
// I wonder if they allow this, with 'template<Intergral T> concept bool Unsigned();'
template<Unsigned T>
T binary_gcd(T a, T b);
 
user1804599
@FredOverflow nullptr
 
12:25 AM
@MohammadAliBaydoun thanks
 
@LearningC You must press TAB instead of ENTER :)
 
@LearningC Yes, pretty much
 
@zch You win.
 
zch
void(*)()
 
12:27 AM
@not-rightfold You also win.
 
thanks
 
zch
What do I win?
 
@zch Function pointers are not pointers.
 
user1804599
@zch That’s a function pointer, not a pointer.
 
@zch The argument.
 
12:27 AM
@FredOverflow I can only show you a pointer that does not have an iterator_tag.
 
zch
I lost now, I guess.
 
user1804599
@FredOverflow 0
 
So I was looking for the paper that introduced std::begin, std::end, std::next, and std::prev
and in the progress I found at least 5 failed range proposals
 
@not-rightfold 0 is not a pointer, although it can implicitly be converted to one.
 
0 is an octal literal.
 
12:28 AM
@Rapptz Is 0 the octal null value?
 
Octal literals need to die.
 
0 is the number of times I've gotten laid
6
 
How old are you?
 
user1804599
@FredOverflow Actually, the language should allow arbitrary bases.
 
user1804599
Erlang does this nicely.
 
12:29 AM
17, which is one of the reasons why~
 
Don't worry, you've got plenty of time then.
 
user1804599
8#777 %% octal
16#FF %% hexadecimal
17#FG %% I fucking hate you
 
@not-rightfold No it should not. Why would you even consider this a good idea?
 
@LightnessRacesinOrbit I drink a lot. Very slowly. :P
 
user1804599
12:30 AM
@CaptainGiraffe Why limit it?
 
@not-rightfold Because the value "frood got a nice towel" might be confusing.
 
I'm with the giraffe here.
 
user1804599
All magic numbers are confusing.
 
user1804599
Let’s not have literals at all.
 
I'm comfy with bases and stuff. Not so with base 37.
 
zch
12:32 AM
@FredOverflow, The type of a pointer to void or a pointer to an object type is called an object pointer type. [ Note: A pointer
to void does not have a pointer-to-object type, however, because void is not an object type. — end note ]
*The type of a pointer* that can designate a function is called a function pointer type.
 
user1804599
@FredOverflow x in int *x;.
 
user1804599
UB! :D
 
zch
Only member pointers are excluded from being pointers: "Except
for pointers to static members, text referring to “pointers” does not apply to pointers to members."
 
@EvgenyPanasyuk: Someone made an error. What is the purpose in speculating why they made that error? — Benjamin Lindley 43 secs ago
 
I can't find the paper that added next or prev at all
 
12:34 AM
 
zch
Yey!
 
@not-rightfold not if you define it at namespace scope ;)
 
user1804599
> C++
 
user1804599
Such a beautiful clusterfuck.
 
I believe I have found the reasoning
 
12:36 AM
I am 0xDEADBEEF I am your mortal enemy!
 
this was DR 1011
 
@Rapptz I only see DR, which is not clear.
 
yeah
it changed it for the use case I only hammered and posted here 3 times
it's even in the answer
 
And I'm 3435973836.
 
back to looking
 
12:38 AM
(No, that is not a random number)
 
user1804599
Yum, ice cream.
 
I'm upvoting rici since he manages to explain it (again..)
honestly, std::next makes no sense for InputIterators
 
@Rapptz the same reasoning is applied for std::find and other similar algorithms
 
@MohammadAliBaydoun We c what you did there.
 
the use cases of an algorithm and next are different
 
12:41 AM
@CaptainGiraffe That number only appears in my darkest times :D
 
:/ I can't find the paper that introduces them
 
Right. But nobody submitted a defect report to change std::find(). — Oswald 3 mins ago
 
OK, I may have had far too much Timothy Taylor's Landlord tonite, but I'm getting really pissed off with 'Please debug my walls of code with no effort, no environment and the implict request do someone else's work for them'. I may get banned soon..
 
He want to make find to work only on ForwardIterator?
 
@EvgenyPanasyuk ask him?
 
12:44 AM
I've honestly never used std::find with istream_iterator lol
 
Yes, that's what I mean. — Oswald 32 secs ago
 
sounds neat though I guess shrug
 
Guys, something is wrong with me.
 
oh hey I think I found it
 
I actually agree with some negative user reviews on Metacritic.
 
12:49 AM
never mind, I give up. I don't care anymore
 
Worst joke of the year goes to: Why do c++ programmers wear glasses?
 
zch
This is not joke of this year
 
@CaptainGiraffe Oh... go on...
 
Might be from 2002 for all I know.
They don't see sharp.
 
float nan() { return 1.f/0.f; } <- Can't believe I'm actually doing this :|
 
12:51 AM
Please, what's the rubbish punchline?
 
Or C sharp.
 
OK, I just got the rubbish punchline...
 
Or C#.
 
@MartinJames He just gave it. It's less "rubbish" than just lame.
 
Cee Sharf
 
zch
12:52 AM
@MohammadAliBaydoun It's INF, not NaN
 
Dess is not a good grade.
 
@MohammadAliBaydoun Also comparing against nan or inf is useless
 
Blah
Fuck it, I'll just throw
I was deciding what to do upon normalizing a zero vector
 
@Rapptz Comparing against NaN is sometime useful: bool isNaN(double in) { return ! in == in; }
 
> One of the best games I have ever played, even if it doesn't qualify as a 'game' it's an excellent story of cause and effect, a must play for everyone!
With a score of 0.
I don't know what to believe, guys.
 
12:53 AM
I'm not throwing tonight. I had a sandwich before I went out and a pizza after I got in. Feeling fine.
2
 
@EtiennedeMartel Believe it's controversial?
 
@MartinJames Excellent.
 
also, std::numeric_limits<double>::quiet_NaN().
 
Oh, totally forgot about the functions in std::numeric_limits
 
you can't do NaN == NaN though
you have to do !(NaN == NaN) which is pretty dumb
 
user1804599
12:57 AM
"foo" is NaN. vOv
 
user1804599
 
user1804599
Want want want.
 
@not-rightfold Looks tasty.
 
user1804599
It sure is.
 
1:02 AM
@not-rightfold Not now, maybe tomorrow. What is it?
 
user1804599
@MartinJames pea soup.
 
user1804599
Erwtensoep, ook wel snert genoemd, is een dikke soep, gemaakt van spliterwten. Andere landen, zoals Engeland en Duitsland, kennen ook erwtensoep, maar het traditionele Nederlands gerecht dat in de winter gegeten wordt is een sterk gebonden versie. De soep smaakt het beste als deze in een grote hoeveelheid wordt bereid, en daarna voor consumptie nog een dag blijft staan. Gekoeld blijft de soep een aantal dagen goed, maar hij kan ook prima worden ingevroren in een diepvriezer. De hoeveelheden van de diverse ingrediënten variëren. In totaal moet er zoveel groente aan de soep worden toegevoeg...
 
Ook ook
 
Would you consider it good or bad practice to assign to class members in the declaration?
 
There is a party upstairs and I can't sleep
Everything's terrible
 
user1804599
1:03 AM
@CatPlusPlus Molotov cocktail.
 
Wot? You want me to put that through 'Translate'?
 
Oh it's pea soup.
 
@CatPlusPlus Go to the party!
 
Go get some chicks.
 
Because I have so huge success rate
 
1:05 AM
@EtiennedeMartel Yeah - living next-door, or underneath, or on top, is an auto-invite.
 
I've been to a party where I've barely known anyone and it was meh
And here I know nobody so
 
Not enough alcohol.
 
@CatPlusPlus Go, and you will get to know somebody..
 
Oh there was too much alcohol
Like "oh crap the freezer is too small"
 
@CatPlusPlus Not usually a problem.
 
1:07 AM
@MartinJames That doesn't work
 
@CatPlusPlus It does for me.
 
Well, I'm terrible at life, so it doesn't for me.
 
Fucking glitch in the Matrix
it’s 01:09am … again!
 
lol
 
why
 
1:10 AM
DST changes
 
@Rapptz DST.
 
@CatPlusPlus Try harder, you may be surprised:)
 
@CatPlusPlus With that attitude...
 
now?
 
@DeadMG Dick Sucking Theory?
 
1:10 AM
@EtiennedeMartel Daylight Savings Time.
 
Yes, now
 
the clocks just went back an hour.
 
and I fixed my botched plots
yay me
okay, time for bed
 
@DeadMG Yeah - and Lightness didn't shut down his DB servers :)
 
user1804599
1:11 AM
@EtiennedeMartel GNAA
 
Oh.
For us it isn't until November 3rd.
okay then.
 
I don't know what time it is
 
Silly Americans getting everything wrong
2
 
@MartinJames I don't know what time is.
@CatPlusPlus As if there were any real right or wrong to this nonsense.
 
DST sucks regardless
 
user1804599
1:13 AM
My mother was born on November 3rd.
 
My Windows box says 01:12, the radio clock on the office wall says 02:12.
 
@EtiennedeMartel Beh
 
2 of my friends were born on November 4th
 
Wondows bix
You're in an office?
 
@CatPlusPlus Fick uff.
 
1:14 AM
@MohammadAliBaydoun How do you recognize a Lounger telling a lie? He claims to have friends.
7
:-)
 
@JerryCoffin I have enemies, does that count?
 
@JerryCoffin My enemies have enemies, it's close enough ;_;
 
@EtiennedeMartel "Dick Sucking Theory can be applied to any situation!".
 
@MartinJames Yes, but can only count to 3.
 
just imaging President Obama getting down to suck Angela Merkel's dick so she won't get all hacked off about the whole spying thing
 
1:16 AM
The enemy of my enemy, is.. just another enemy.
 
@DeadMG I'm sure Merkel has a rather sizeable sausage.
 
@EtiennedeMartel Well, they do say that Germans have great sausages.
 
true.dat
 
@EtiennedeMartel On that note, I need to sleep, preferably without any dreams, German or otherwise..
 
1:20 AM
man
 
@LightnessRacesinOrbit stackoverflow.com/questions/19613305/… - what do you mean?
 
I could really go for some pork and apple sausages right now.
in fact, I could just go for some tasty food, in general.
 
@EvgenyPanasyuk Exactly what I said.
 
I'm totally fucked now. I need sleep but I'm gonna be stuck with Angela sausage dreams all night :((
 
@LightnessRacesinOrbit "That's why." - what "why" ?
 
1:21 AM
@EvgenyPanasyuk Read the comment.
 
anyone here watch baseball?
 
@LearningC No
Night all!
 
@LearningC No
 
night
 
@LearningC ...only at gunpoint.
 
1:23 AM
lol
even if you don't watch baseball. Do you know why do fans swing a white shirt in baseball?
 
@LightnessRacesinOrbit I don't understand what do you want to say by it.
 
@EvgenyPanasyuk Then I suggest spending some time contemplating
Study it for a few weeks as you would any other great wisdom
 
@LearningC For the second time tonite... go on...
 
@LightnessRacesinOrbit it is just irrelevant.
 
1:25 AM
@EvgenyPanasyuk No, it's not.
 
It is.
 
@EvgenyPanasyuk I am sorry that you have failed to understand it.
Better luck next time, I guess
 
Baseball, Merkel sausages... why do I log on here?
 
@MartinJames I have no idea: I haven't logged into SO chat in quite literally years
 
@MartinJames I was wondering why and hope one of you can answer. I was watching the world series and a lot of fans stood up and started swing something white.
 
1:26 AM
I find it very sexist to say a women with will & power must have a male's productive organ
 
@LightnessRacesinOrbit On top of that, the starboard has 'anal showers'. I'm having a double Highland Park and going to bed. BFN.
 
@MartinJames \o/
 
BTW this is telkitty @_@
 
@LearningC Top tip: the "World Series" is nothing of the sort
5 mins ago, by Lightness Races in Orbit
Night all!
 
@LightnessRacesinOrbit I don't understand what you mean
 
1:30 AM
@LearningC It's called the "World Series" yet only USA teams may participate. It's an arrogant sham.
 
@LightnessRacesinOrbit Oh. Lol good point
 
> MLB, its players, and North American media sometimes informally refer to World Series winners as "world champions of baseball."
Cunts...
ahem
2 mins ago, by Lightness Races in Orbit
5 mins ago, by Lightness Races in Orbit
Night all!
 
@LightnessRacesinOrbit There are some Canadian teams, I believe...of course, I don't follow baseball, so maybe I'm just making that up...
 
That and Football, yes?
 
as if anyone except America gives a shit about baseball
 
1:35 AM
Why is there not an std::sign?
 
@DeadMG In Russia, there are baseball bats in sport shops. But I never saw that anybody used them to play baseball.
 
@Pawnguy7 Nobody gave a sufficient shit to propose it, most likely.
what would that even do.
 
well
 
user406009
Somewhat close.
 
user406009
1:40 AM
(Although only for floating point numbers.)
 
> 0, 1, < 0, -1, 0, 0?
But like.
std::abs.
Is simpler, is it not?
 
1 message moved to bin
Don't do this
 
@Pawnguy7 What does that mean?
 
Oh. It seems I lost formatting.
std::sign(6) = 1. std::sign(-6) = -1; std::sign(0) = 0;
 
@CatPlusPlus Sorry, cop. :<
 
1:43 AM
int sign(int x)
{
    return (x >> 31) - (-x >> 31);
}
 
@FredOverflow You like bitshifts, don't you?
 
What's std::sign?
 
What's not to like? :)
@Rapptz doesn't exist
 
@Rapptz nonexistent
 
Don't use signed shifts
 
1:44 AM
@FredOverflow understanding, probably. I saw a weird one in SFML.
 
was it 1 << 1?
because that's common for flags
1 << 1, 1 << 2 etc
 
Don't think so. I cannot find it.
 
int sign(int x)
{
    return (x > 0) - (x < 0);
}
@CatPlusPlus better? ;)
 
Now, std::abs = value >= 0 ? value : -value, right?
Um...
 
int abs(int x)
{
    int m = x >> 31;
    return (x ^ m) - m;
}
 
1:47 AM
Do you use them a lot? Such things don't come naturally for me.
 
int abs(int x)
{
    return (x < 0) ? -x : x;
}
 
constexpr abs(int x) { return x > 0 ? x : -x; }
 
Yes, even better.
So if something that simple has a function.
 
@Rapptz Why would you negate 0?
 
Why not sign?
 
1:48 AM
0
A: boost::spirit access position iterator from semantic actions

seheThis has been a fun exercise, where I finally put together a working demo of on_success[1] to annotate AST nodes. Let's assume we want an AST like: namespace ast { struct LocationInfo { unsigned line, column, length; }; struct Identifier : LocationInfo { std::string name; }; stru...

@JerryCoffin ^ think that'll do?
 
@FredOverflow iunno. :)
 
abs has a function, because it can be mapped to an instruction
 
yep
 
m_pixelBuffer[index] = ((pixels[x / 8]) & (1 << (7 - (x % 8)))) ? 255 : 0;
Found it.
There are several more shifts, I think. sf::Font.
Though I guess that is not only a shift.
 
user1804599
user image
3
 
1:50 AM
Oh God, I've forgot that sound.
 
if I wanted to check if a word reads both the same both ways. should I change it to an array then check?
 
user1804599
Google is funny.
 
@LearningC like racecar?
 
@Pawnguy7 yes
 
it's called a palindrome.
and there are probably a million and a half algorithms for it online
 
1:53 AM
this can be done in C?
 
user406009
Doesn't the string class support operator[]?
 
Off the top of my head, make a reverse copy of the string.
Then, comparing indices on opposite ends, and if you reach the end (all being true), you win.
 
this can be done in c?
 
Probably. Let me try this.
 
1:57 AM
@not-rightfold man pages is a stupid name :P
 
@LearningC no it can't
@LearningC not even in lowercase c, no
 
ok ty
 
Sorry. Lemme ignore go to sleep
 
im working on problems from projecteuler
 
@sehe night bear
 

« first day (1107 days earlier)      last day (3844 days later) »