« first day (1541 days earlier)      last day (3400 days later) » 

4:00 PM
@Jefffrey flag dodger
 
Ell
I dont understand how iterators can be shit and ranges can be the shit when they are so similar
A range is a pair of iterators isn't it?
 
Not necessarily.
 
@Ell No.
a pair of iterators is a range, but a range is not a pair of iterators.
 
In the same way that a number is a series of bits.
 
^
 
4:02 PM
@Ell I think iterators are great.
 
@Ell Enjoy writing your x.begin(), x.end()
 
Take for example a range that goes from 0 to 10: sequential_range(0, 10). It could be implemented with a single internal counter and a proxy "iterator".
 
@rightføld It's dumb. It should be way simpler than that.
 
Ell
@milleniumbug that's about xonvenience though right?
 
think of it like this- iterators are the shitty version of ranges.
 
Ell
4:04 PM
But you say "iterators are shit"
 
As it is now it is simpler to use a function to convert the string to a vector<string> given some custom delimiter than to use a stream_iterator
 
Ell
Why are they shit?
 
They are not shit.
 
Ell
Is it because they are inconvenient to use or because they aren't as "powerful" as ranges?
 
Both.
 
Ell
4:05 PM
Also out of interest, what range points to a single element?
 
A singleton range.
 
@Ell Both.
 
[x, x]
 
iterators are hideously inconvenient to use in many ways, and also, they can't effectively represent many useful ranges.
 
wut
I swear Puppy has a list of nonsensical claims that he picks from a hat each day to troll us with.
7
 
Ell
4:06 PM
@Puppy what can't iterators represent?
 
@LightnessRacesinOrbit Said the troll.
 
Your mom
 
well, imagine a map or filter iterator.
Boost has these iterators but they don't really work very well.
 
#define RANGE(x) begin(x), end(x)
 
also, they are not easily abstracted- again, Boost has an any_iterator but it's not something you really want to use.
 
4:07 PM
Have I won the Worst Code Ever Award?
 
no.
 
@milleniumbug Nope
The multiple evaluation problem isn't insurmountable, btw. Check this code a smart guy did --> pastie.org/357910 It provides a foolproof "RANGE(foo)" macro that generates "foo.begin(), foo.end()" basically, but it's applicable for addressing any multiple evaluation. Runtime overhead, though. — Iraimbilanja Jan 11 '09 at 13:57
 
Ell
I'll look at boost iterators now
 
@LightnessRacesinOrbit said the trol with far too many hats in far too many senses /cc @Jefffrey
 
user1804599
sehe you unix master are you familiar with ping?
 
4:11 PM
still the same
You were looking for a OSI model expert and networking expert the other day. /cc StackedCrooked
 
user1804599
I'm totally puzzled.
 
user1804599
But nvm, I asked on Unix & Linux.
 
@milleniumbug I was being massacred once for suggesting a similar macro.
 
Getting dark already. Oh well, I had half an hour of lightness. Even half an hour of lightness is better than no lightness.
 
@rightføld int i = 1e6; works in C++, does it not?
 
user1804599
4:14 PM
No idea, but I'm writing Clojure.
 
@FredOverflow Technically you might get 999,999 out of that
in practice you're not going to
 
@rightføld How does one cast in Clojure? What's the equivalent to the Java (int)1e6?
 
user1804599
(int 1e6)
 
int i = round(1e6) is your guarantee but then it's no longer a constant initialisation innit
 
user1804599
And downcast is (identity x) because it's dynamically typed. :P
 
4:15 PM
It's no guarantee, is it?
 
the fact that it's a constant initialisation is also why int i = 1e6 is probably "safe" in practice
 
Could be 999999
 
@LightnessRacesinOrbit All integral values up to 9e15 fit perfectly well into a double.
 
@R.MartinhoFernandes Well, granted. :P
@FredOverflow Maybe on your system....
 
@FredOverflow not without warning on conversion from double to int
 
4:16 PM
Show me a system that converts an even double into an odd integer.
 
that old chestnut
You realise I've been saying it works "in practice" this whole time, right?
So not sure why you're hounding me to find practical counterexamples
 
Sneezing is awesome.
 
Especially when my hands are so cold it hurts to type
You sadist
 
Because I'm sick of C++ and all its implementation-defined, unspecified and undefined behavior.
Why can't 1e6 just be guaranteed to be a million, damnit?
 
user1804599
@FredOverflow (defn f [x] (if (== x 0.0) 1))
 
4:18 PM
@rightføld That's not a system, that's a Clojure function.
 
user1804599
It converts the double 0 into the integer 1 and everything else into nil.
 
1e is a double representation
 
1e6i might have been nice
 
user1804599
@FredOverflow What is your definition of "system"?
 
4:18 PM
@LightnessRacesinOrbit I know all about IEEE754. Again, integers up to 9e15 are no problem for double.
 
@FredOverflow Again, you're either not listening or being deliberately obtuse.
 
@Fred because then people would want 1e9 to be a billion and that'd be wrong.
 
ObtusenessOverflow
@FredOverflow 1e6 is one example. What happens when you go over 9e15?
 
@LightnessRacesinOrbit There are no odd numbers above 9e15.
 
...
9e15+1 is pretty fucking odd mate
 
Ell
4:20 PM
Odds numbers are like 5, 21 or 98
5
I think there are only a few others.
 
How is 98 odd?
 
1 -> int
1u -> unsigned int
1. -> double
1e1 -> double
so you need to cast explicitly to avoid warning : auto i = int(1e6);
 
never do anything to "avoid warning"
do things to "avoid having incorrect program behaviour"
 
Ell
I'm trolling :P
Im bad
 
int i = 1_000_000;   // problem solved
 
Ell
4:21 PM
In general
 
No wait, what's the separator for C++?
 
@FredOverflow It's looking funny.
 
user1804599
'
 
int i = 1'000'000;   // or something
 
4:21 PM
37 mins ago, by Lightness Races in Orbit
1_million
 
well sure i wouldn't even think about using 'e' to make an integer
 
@rightføld Why did they go with that?
 
@FredOverflow Because they are the ISO C++ {core language, library} working group
 
user1804599
Because 1_0 is a UDL call.
 
nutjobs
 
4:22 PM
because '_' is a character accepted in identifier where as ' is not
 
1,000,000 would have been fine. Who the fuck applies the comma operator to 1, 000 and 000?
 
and '_' is not better
 
_ is marginally better but I agree with you in the main
 
Ell
I like '
 
yeah ',' is more intuitive since it is the way english uses
 
Ell
4:24 PM
, is comma operator and _ is UDL
 
other places use .
 
Ell
I don't see the problem with '
 
Arguing intuitiveness from English is silly.
 
I strongly suspect they didn't even consider , or . because of localisation problems
better to go with something that nobody uses Sigh
 
4:24 PM
but did you know we use '.' in france ?
 
yes.
 
in fact I just said it
 
Ell
Well we already use . for decimal point
 
France uses , for decimal ploint
 
Ell
4:25 PM
In c++ I mean
 
but France eats snails so y'know
right ;p
 
Ell
10.20f
 
(inb4 "I didn't know a country could eat" from @Jefffrey)
 
@R.MartinhoFernandes I somewhat disagree. Programming is hardly multilingual, so it could be argued that lifting from English is intuitive, although the actual thing being lifted is, as usual, insane.
 
reluctantly I must agree with the rabid dog here
 
4:25 PM
@hlide As does Germany.
 
That's not the same as being intuitive.
 
let's list all the countries that use . thousands separators. that'll be a fun game
 
intuitive for English speakers maybe.
 
the English way makes more sense, though, in ALL European languages, due to the "break apart" meaning of , and the "termination" meaning of .
that doesn't make it intuitive for speakers of those broken languages, of course, but...
 
Btw fuck y'all.
 
4:27 PM
inb4 flag
 
yes please
 
An interpunct ( · ), also known as an interpoint, middle dot, middot, and centered dot (UK centred dot), is a punctuation mark consisting of a vertically-centered dot used for interword separation in ancient Latin script. (Word-separating spaces did not appear until some time between A.D. 600 and 800.) It appears in a variety of uses in some modern languages and is present in Unicode as code point U+00B7 · middle dot (HTML &#183; · &middot;). The multiplication dot (U+2219 ∙ bullet operator (HTML &#8729;) or U+22C5 ⋅ dot operator (HTML &#8901; · &sdot;)), whose glyphs are similar or identical...
 
when do you want to get together?
 
1,234·50
I'd be okay with that
as long as we get a digraph to go along with it
1,234<^50
 
well it is not really an issue for me since I can deal with english
 
4:29 PM
actually... 1·234.50 isn't too bad...
 
Separate thousands with the word "thousand" because operators are confusing
 
hmm
1 thousand 234 thousand 567.80
 
And also no dots
 
4:29 PM
1 thousand 234 thousand 567 cat 80
this is beginning to look like Zoidlang
seriously tempted to write a translation pass into my codebase to remove · between integer digits, and use them globally for thousands separators. hmmm
int x = 1·234; // the ultimate troll
seriously though why can't we just concatenate adjacent literals by default: 1 000 000.5
what else could that possibly mean
who's got the paper handy
ahaha second google result:
 
 
1*1000*1000 + 0.5 // fuck you all
 
^ first two sentences
 
just write as a binary base plynomial
 
4:33 PM
@LightnessRacesinOrbit :P
 
Xeo
@LightnessRacesinOrbit right. totally looks like C++
 
with a shift to mark the exponent part :p
 
@LightnessRacesinOrbit Sounds like a Lounger.
 
and from the link posted, it does look a majority of countries uses ',' instead of '.'. Was there a bet ?
 
no.
 
4:38 PM
hi all... have any of you tried to implement a signals and slots system kind of like Qts? im trying to do that in a very naive/simple c++11 way and want a library i can use for event loops/timers etc. Ive been checking out boost.asio and libuv... I'm looking for any general thoughts or opinions you might have
 
that's not open-ended at all
 
no.
 
There is one I recalled which is simple
and only uses standard stl
 
@Pris My thought is why are you writing this again
 
Stephan can do signals and slots?
that's new to me.
 
4:39 PM
0
Q: Why was the space character not chosen for C++14 digit separators?

Lightness Races in OrbitAs of C++14, thanks to n3781 (which in itself does not answer this question) we may write code like the following: const int x = 1'234; // one thousand two hundred and thirty four The aim is to improve on code like this: const int y = 100000000; and make it more readable. The underscore (_...

 
it was a long time ago
but i suspect there are plenty ones since then
and if you could afford variadic template you could make it lighter
 
I want Uncharted on PC
Please.
 
Ell
@hlide boost has a signal/slots library
 
yep but this one is just a header
and maybe enough for simple tasks
 
now's the time for y'all to come up with examples that break 1 234 567 and win me a hat
 
4:46 PM
I like Boost but I find hard to add Boost on a project because of the zillion of headers AND dll files you need to make it compile
 
I DONT SEE ANY ANSWERS PEOPLE
 
@milleniu just for kicks; im not trying to reinvent the wheel, just want to learn/do some basic stuff on my own @Ell im aware
 
sorry, what was your question :p
 
Ell
@hlide boost signals 2 is header only also
But as pris clarified he just wants to exercise anyway
 
nope
it needs a lot of other headers to compile
 
header dependency for Boost is a madness
 
Ell
That doesn't make it not header only :P
 
theres a neat tool to only grab what you need from boost for a specific module
 
Ell
I'm sure whatever this guy writes will depend on other headers too.
 
4:51 PM
0
A: Why was the space character not chosen for C++14 digit separators?

Albert RenshawI would assume it's because, while writing code, if you reach the end of a "line" (the width of your screen) an automatic line-break (or "word wrap") occurs. This would cause your int to get split in half, one half of it would be on the first line, the second half on the second... this way it all...

 
Ell
Like <functional> maybe
 
#include <set>
#include <list>
that's all
 
im using functional for signals
 
4:53 PM
and include <windows.h> or include <pthread.h> for multithreading
 
@hlide Why bother with that if you have C++11 anyway.
 
btw did I hear correctly that Filesystems TS has been accepted?
 
well #include<thread> didn't exist at this time
 
what time
#include <boost/thread.hpp>
 
4:57 PM
If you want to start something simple, and learn how to do signal/slot before attacking more complex stuff
 
12 minutes left
 
I'm not saying to use it instead of Boost
 
gimme answers
 
probably because it would be a madness to token a number with space in-between
 
4:58 PM
and to disambiguate several rules
 
@hlide why?
@hlide please provide evidence of ambiguity
 
thinking...
c preprocessor consider space as dispendable (?), meaning you get a sequence of tokens without space
now you want be able to merge a sequence of tokens into one
is that desirable ?
it is true i see no practical meaning to: if (a == 1 1 1 1 1) ...
so digits might be mergable without real ambiguity
but what about hexdigit? 0 x 1 a B 2 3 ?
there is no way to disambiguate from a typo doing so (normally we should see an error)
 
user3010322
I wonder if I can variadic template my variadic templated type...
 
user3010322
template <type_list<class...>...>
 
I think I saw an example of it
 
user3010322
5:09 PM
Let's try it!
 
but you need to stick with 'class'
 
I've always had class.
 
guffaw
@hlide String literal concatenation works just fine
@hlide that's a good answer - fancy posting it?
 
user3010322
template <template <typename...> class pack_of_lists...>
struct off_rocker {};
 
user3010322
I can't get a variadic pack of lists going with that syntax.
 
user3010322
5:14 PM
The last ... is illegal.
 
user3010322
Maybe I need to just take typename... lists
 
yes I was thinking so for string concatenation. "fancy posting it?' what do you mean?
 
user3010322
And then use recursion to break it one by one.
 
@hlide would you like to post that rationale as an answer to the question
 
oh i didn't see it was a post
 
user3010322
... OOH
 
user3010322
it has to come BEFORE the name.
 
user3010322
That's kinda nighty.
 
user3010322
nifty*
 
user3010322
Also, Hi Xeo!
 
user3010322
5:16 PM
Happy New Year!
 
Xeo
That's how it is all the time vOv
 
user3010322
chat throttling, plz.
 
thanks @hlide
you've got some formatting problems there
 
I, too, would appreciate it if chat throttled you a bit more
 
@LightnessRacesinOrbit is that better?
@ThePhd it seems the place of ... has a different meaning if it is to be at the left or right of an template-id (?), so it you want expand it, it should to the right
 
user3010322
5:25 PM
No, to the right is almost always invalid.
 
are you sure?
 
user3010322
@Xeo But what if I want to actually fill those "blah"'s with different types?
 
user3010322
like blah<int>, blah<int, int>, etc?
 
template<typename ...id> using bar = foo<id...>;
 
user3010322
5:27 PM
It seems to complain that it's not an expected type.
 
user3010322
To the left of the actual Id for the typename, sorry.
 
user3010322
I should be specific.
 
user3010322
Arrgh.
 
user3010322
I brokded it again.
 
Yeah not so modern, I am going to edit @BenjaminLindley. — G. Samaras 4 mins ago
lol
way to miss the point
 
5:30 PM
@ThePhD blah<int> is not a template, so it cannot go there. It is a type.
 
user3010322
.... OOOOOOOOOOOOH.
 
user3010322
Lightbulbs.
 
user3010322
Aww, damnit.
 
user3010322
I still broke it.
 
user3010322
Yeah I don' think what I want is possible at the top-level then.
 
user3010322
5:32 PM
template< template<class...> type_list... packs> <--- type_list is an actual class that takes a variadic number of packs, can't nest it like this.
 
i fail to grab what you want to achieve here
 
user3010322
Instead, I just have to just process 1 type list at a time.
 
user3010322
I'm writing a template-based overload resolver.
 
user3010322
You give it 20 functions and it'll give them all the same name and then perform overload resolution on those functions when it gets called based on the arguments provided.
 
user3010322
The function signatures are compile-time, but
 
user3010322
5:36 PM
The reason I want to have all of the type-lists arrayed out as once is because overload resolution can be done much more efficiently by traversing ALL of the lists at hte same time and doing elimination steps
 
user3010322
So if yo have...
 
user3010322
int, int
bool, bool
int, double
 
user3010322
As your overloaded set
 
user3010322
And you get bool as the first argument when someone does the function call,
 
user3010322
in a top-down implementation you'll process number 0, fail, and then process option 1, know it's okay, and then process option 2, and fail it
 
user3010322
5:38 PM
That'll leave only the middle one left
 
user3010322
But with an overloaded set like...
 
user3010322
int, int, int
int, int, double,
int, int, string
 
fucking hell
shut up
 
user3010322
Oh. Sorry. :c
 
5:39 PM
Yeah don't interrupt this other conversation that's going on
 
the problem is not about interrupting anything
 
☎->✆(); // take my phone (☎) off hook (✆)
damn that's readable
 
the problem is causing the titlebar to say "40 unread messages" goading me into thinking there's some useful discourse to read
@milleniumbug it's not even correct. if ☎ is supposed to be a phone then why was it declared as a pointer?
 
a very old one indeed, everybody know smartphones rule now
 
@LightnessRacesinOrbit meh they propsed new notation ☎✆(); to avoid this problem ;)
 
5:43 PM
pfft
 
I have no idea what the fuck that 2nd symbol is even supposed to be.
 
@Puppy You're too young to remember.
 
not bad
but where is Australia?
 
18
Q: Celebrating the same new year several times over?

nsnIs there a commercial service offered to general public that allows you to celebrate the new year several times? The idea is that you would celebrate it in a time-zone and than move to the next one arriving there before new year. Of course this is relatively easy to accomplish by yourself if you...

@hlide look to the left
 
5:52 PM
@hlide There is a hint of it on the left with New Zealand as well.
 
@ThePhD if I understand well, you want to give an overloading order resolution where you may have ambiguity with the usual overloading resolution of c++ compiler?
 
hello
 

« first day (1541 days earlier)      last day (3400 days later) »