« first day (1091 days earlier)      last day (3859 days later) » 

9:00 AM
@TonyTheLion How many lions were there?
 
where?
what the hell is going on in the PHP room?
flag wars
 
Belgium is a single struct. False. It's a namespace for a bunch of unrelated yet strongly coupled types with poor encapsulation and lots of resource leaks.
4
 
@DeadMG Yeast is not an animal. Case closed.
 
TIL that mouse hovering over nicks of people in comments gives you their rep in tooltip
 
9:16 AM
I always do it out of habit. Don't really know why.
 
JBL
Mmmh. Would it be considered bad practice to rely on constructor list initialization order ?
 
@JBL nope, it's ok
 
@JBL What do you mean? I don't think it can be reordered in C++98.
 
JBL
@Rapptz Like, initialize members based on other members previously initialized.
I don't know why but I sense this isn't good...
 
Oh. That's okay to do.
 
9:19 AM
@JBL It's fine. Just keep in mind that the order is given by the member declarations, not the constructor initialisers.
(GCC warns if the two don't match)
 
@JBL you can even write struct X { int a{1}; int b{a+1}; };
 
JBL
@R.MartinhoFernandes Yep, know that, and I keep my init list coherent with that.
Ok, thanks all ! I don't know why, it felt wrong in my mind...
 
I started getting into the habit (I don't know why I never did it before) of having a develop and master branch.
 
Xeo
ASFHILAVGFAHF
 
?
 
Xeo
9:27 AM
I had an if (userdata) check in my callback hooks
unfortunately, that also yields false if userdata is != null - namely, when it's 0. :|
 
lol.
 
Xeo
I hate that.
 
what language is that shit?
 
Xeo
AS3
Or, really, any language which has nullable references and doesn't require specific access to get the value.
JS will likely do the same shit
 
Lua wouldn't
 
9:32 AM
Hm. C++ seems to use the same function name to get/set.
Example I was looking at
 
Xeo
Ya
 
Cool.
I like it.
 
Xeo
@DeadMG That's nice.
 
> I'm a butcher. My life's at steak everyday.
 
i c wut u did
 
user1804599
9:37 AM
Man.
 
user1804599
I’m tempted to do this component in Haskell instead of PHP.
 
How do you guys deal with long initialisation lists?
 
What do you consider long?
 
>125 columns
 
JBL
I collapse them in my IDE.
:>
Wait, for ctor, or for any kind of init list ?
 
9:45 AM
there are other kinds?
 
JBL
I was thinking of initializer lists.
 
@Xeo, I can't reproduce that bug with non-LTR order of execution in initializer-list. maybe it was already fixed in GCC - coliru.stacked-crooked.com/a/e0f89d690c415da7
 
Xeo
Erm, as I said, arrays have been forced-LTR-init since C++98 IIRC
That's aggregate-init, FWIW
What doesn't correctly work in GCC is braced-init-lists
 
@R.MartinhoFernandes I'd say anything > 6.5" is long source
@TonyTheLion Too true. Especially if he/she is not very good at it.
@Rapptz That's common idiom, yes
 
@Xeo oh, right. they really don't.
 
9:52 AM
@Xeo for what?
 
Why is it left to right?
 
Xeo
It should be LTR, but isn't
 
Oh oops. I meant right to left.
 
Xeo
Bug
 
9:54 AM
That's almost as weird as the sizeof... and % bug
 
@Rapptz yep, and you can't grep setters later =(
 
@Rapptz That's runtime-library :/
 
Xeo
GCC normally evaluates function arguments RTL, and the braced-init-list results in a function call (constructor).
 
You should file a bug report.
 
@Xeo This example is so awesome in it's succinctness. Had me looking thrice to see what was being done. Nifty
 
9:55 AM
Yeah that's a nice SSCCE
> GCC and the GNU Toolchain Project now have accounts on Twitter and Google+ to help developers stay informed of progress.
heh
 
Xeo
Could be shorter, I've just taken @Abyx' snippet
 
@Abyx You can if you have consistent code spacing, or you can grep a regex identifier\s*(\s*\S*?\s*) (sticking to common subsets, I'd usually grep for mentions, then filter the read accesses)
 
@sehe grep what?
 
@Abyx code.
3 mins ago, by Abyx
@Rapptz yep, and you can't grep setters later =(
 
I just can't parse that regex
 
Ah
 
Xeo
It's been in there for a loooong time :(
 
\s is whitespace and \S in non-whitespace? and how can it help to find only setters?
 
@Abyx Because the getters are () while setters are (arg)?
 
ah.. maybe with \S+
 
Xeo
10:00 AM
Hm, open-std.org seems to be down
 
@ScottW I.. have no cereal :(
I'm still surprised those exist.
 
but still, getters also can have arguments, like in getSome(index1, index2)
 
Xeo
@Abyx come::getSome?
Meh, I'd walk to the next supermarket to get something to eat, but the weather isn't very nice today. :|
 
If I capture a lambda as an opaque template argument, then can I deduce the signature somehow?
 
Et tu Brute?
 
10:05 AM
decltype(f()) gives me the return type if no args
 
Xeo
Stop saying "capture" if you simply mean a parameter
 
Isn't that the right word?
 
Xeo
"To capture something" is very strongly tied to lambda captures in C++.
 
JBL
10:08 AM
@StackedCrooked Doesn't it yield the function type rather than the function return type ?
 
@StackedCrooked dissect its operator() if it's a closure
 
Xeo
@Abyx No.
 
uhm, why?
 
@StackedCrooked You can attempt to inspect &operator().
 
Xeo
10:09 AM
@JBL The function f, is invoked.
 
Ah, I just figured out the answer in my case.
 
Xeo
@DeadMG NO
Bloody hell, why is everyone suggesting that?!
4 mins ago, by R. Martinho Fernandes
Et tu Brute?
 
The function which accepts the lambda requires a certain signature, so of course I know it. Silly me.
 
JBL
@Xeo Oh right.
 
because it's the only remotely viable suggestion.
 
10:10 AM
See, it was not needed after all.
 
it'll work... for non-polymorphic lambdas, at least.
 
@ScottW always hungry
 
@R.MartinhoFernandes New favourite phrase eh?
 
Xeo
Repeat after me: Lambdas are not special.
 
I know.
 
10:10 AM
...and?
 
Lambdas are special.
 
Xeo
No they're not.
 
they are most assuredly not.
Stack Overflow is a great place for questions.
 
Come on, you guys surely don't think I'm serious right?
 
@Markus rtfm.
 
10:11 AM
@Xeo Lambda's are not not special.
 
Xeo
@Rapptz Poe's Law etc
 
then read it again.
we are not reading it for you.
 
Xeo
Robot, you need a blog post on why trying to obtain the signature of something is bad.
 
user1804599
 
Xeo
I want something to point people to.
@not-rightfold Ew that opening-brace.
 
user1804599
10:13 AM
@Xeo I like it.
 
@not-rightfold So many new lines.
 
user1804599
Where else? On a new line? Go away.
 
user1804599
@Rapptz Uh, well, if you don’t want 125+ character lines you’ll need new lines.
 
@Xeo it's not bad, especially when you need it.
 
Well I'd rather fit more data per line. Just a personal preference.
 
10:14 AM
@Abyx But you don't :|
 
Xeo
@Abyx The thing is, that you don't need it.
 
user1804599
I like either all on one line or one per line.
 
How would you guys write the concept of BinaryPredicate?
You need the signature, kinda.
 
Holy WTF....??!!! NSFW NSFL NSFW NSFL (I dare you click this)
 
10:15 AM
Er, wrong example.
 
cleanup on aisle three
 
Yeah I realised midway. Long day.
 
bool f(int, int, int = 0); is a BinaryPredicate.
 
I definitely forgot the actual example I had in my mind
I know it was related to concepts though and I can't think.
 
JBL
@TonyTheLion NSFW, I clicked and a coworker saw it : "Awwww". Indeed, NSFW.
 
10:17 AM
@TonyTheLion What is it?
 
@TonyTheLion Cute.
 
@R.MartinhoFernandes A basket of puppies.
 
@R.MartinhoFernandes I need it when I need some kind of invoke(func, serialized_args) function. /cc:@Xeo
 
I've written the whole Callable<T, Args...> thing if that counts
 
Xeo
14
A: Call function with parameters extracted from string

XeoUpdate: Updated stream_function to fix the argument-evaluation-order problem @Nawaz mentioned in the comments, and also removed the std::function for improved efficiency. Note that the evaluation-order fix only works for Clang, as GCC doesn't follow the standard here. An example for GCC, with man...

@Abyx Just trying to rely on the signature there absolutely does not help
 
10:21 AM
@Xeo Hm
 
The signature is red(herring)
 
The lack of space between your braces is ugly.
 
@Xeo no, stream_function<int(int,int)>(add) is ugly. I want stream_function(add).
and when and only when I can't use it, I'll use stream_function_ugly<int(int,int)>(add)
 
hmm
I wonder how yield return intersects with nested IEnumerables?
 
@DeadMG You mean yield return enumerable;?
Works fine.
 
Xeo
10:23 AM
concat_map!
 
no, I mean, I have IEnumerable<IEnumerable<T>>.
 
You just can't put it all in one function.
You need one for the inners, and then another that calls and yield returns that.
 
eh
realized I could just LINQ it anyway
 
That's better.
 
this code is going to go terribly wrong
but oh well
 
10:25 AM
Jeez I'm still drunk. Morning lads.
 
DeadMG vs multiple-file parser-combinator errors, Round 2.
 
Xeo
@Abyx Function objects with overloaded / templated operator() would like a word with you.
 
sigh.
why does Visual Studio behave so incredibly fucking badly?
who thought it would be a good idea to eat every user exception?
 
Because it sucks?
 
Xeo
Welp, time for food
 
10:30 AM
@Xeo I'll use the ugly version for overloaded/etc functions, but not for non-overloaded functions.
 
it's almost as bad as Clang.
hmmm... interesting quandary, which is worst, VS or Clang.
 
ITT Puppy is turning into a cat
 
omg lol what about g++ then?
 
> "omg lol"
 
@sehe Nah, that would have to be "Everything is bad".
 
10:32 AM
should I write code like that?
struct A {
    A(X& x) : m_x(x) {}

    X& m_x;
    Y m_y{m_x};
};
 
@DeadMG It sure starts to look that way, izzamapoint
@Abyx Not ever. Identifier should be descriptive
 
why would I care what it looks like?
 
Why do you ask? I know you don't care. And I don't care :/
 
@sehe it's not about identifiers, it's about initialization of members
 
if you do stuff -x 10 -x 11 is the value overwritten or appended?
 
10:33 AM
@Abyx That part is worse :/
 
I'm not too well versed in the POSIX standard for command line arguments...
 
@Rapptz It depends on the program. RTFM
 
Eww, reference members.
 
@sehe Hm.. overwriting it is then.
 
@R.MartinhoFernandes omg what? do you suggest to use raw pointers?
 
10:35 AM
@Abyx Or a sane solution ((free-standing) accessors?)
 
what's accessors?
 
@Abyx Yes.
Reference members are more pain than it's worth.
 
@Abyx I use pointers instead of references for class members
 
Well, pointer or reference_wrapper.
 
user1804599
@sehe What Lisp is that?
 
10:36 AM
I'm just happy to see you
 
@Rapptz Depends on the program.
 
A "key" object which has a private constructor seems a nice way to enforce access control for threads. (This is orthogonal to private/public access control). Also I realized that callbacks are useful.
 
hm... but references have more constraints. it feels like unsigned vs int
 
No, they don't
Non-assignable classes are pain in the ass.
 
I mean references are const non-null pointers
@CatPlusPlus I just make them noncopyable. because they aren't copyable.
 
10:39 AM
@Abyx and they create fuss about value-semantics as class members. No more Rule of Zero. Therefore, "raw references" < "raw const pointers"
 
Assignability and copyability are two different things.
 
classes like NetworkConnection.
 
Perfectly assignable.
 
only move-assignable.
 
With reference members it's impossible to make it assignable in any way.
 
10:40 AM
@Abyx Choices. The name doesn't imply this
 
@CatPlusPlus not really, assert(&x == &rhs.x); will allow assignment (for X& x)
 
That is... useless.
 
well, maybe it is.
 
Reference members are crap.
They're not worth it.
 
^
 
10:42 AM
ok. thanks. I'll think about it.
 
There's a reason reference_wrapper exists.
 
Why does nothing ever fucking work?
 
Because that's your job
 
because making things work is hard.
 
@sehe Ugh
 
10:45 AM
An anti-joke cat, even ITT
@StackedCrooked Ugh that TRACE macro :<
 

« first day (1091 days earlier)      last day (3859 days later) »