« first day (2172 days earlier)      last day (2761 days later) » 

12:10 AM
@Mysticial the things I’ve posted are guaranteed to compile though
 
Yeah, I'm unable to construct on the return value. The only way is to pass a lambda into the constructor of the object. And that starts to get really ugly.
Actually, it's impossible to do the RVO in the general case if its not a prvalue.
Brick function(){
    Brick a;
    Brick b;
    return rand() % 2 ? a : b;
}
Where Brick is not moveable, not copyable, and not copy-constructible.
Fuck
 
Yeah, I actually got fucked by this a day or two ago (noticed thrust was doing deep copies), I think the real solution is to use a pointer or reference to Brick, that way you're moving lightweight stuff
 
12:48 AM
 
-4
Q: How do you design a timer with a queue?

LegolasInterview question: What is the best way to design a timer with a queue?

please kill it
 
1:03 AM
@LucDanton The solution I'm gonna go with is to leave in the extra indirection. I'll wrap the WaitHandle in another object that's movable. Then the WaitHandle goes in the .cpp file along with all the massive headers that it pulls in. So a small performance sacrifice for better syntax and compilation times.
IOW, PIMPL it if I'm going to add the indirection anyway.
 
hello lads
 
<atomic>, <mutex>, and <condition_variable> seem to pull in an infinite amount of headers which hardly any other code will ever need. And this will be including into hundreds of files.
RAPPTZ!!!
 
that's implementation specific :p
 
Also, infamous problem with MSVC's mutex implementation
 
@Rapptz Yeah. At least when I start probing those headers in MSVC, it never seems to stop.
 
1:17 AM
@Mysticial if you’re able to pull all the code that uses the value to return into its own function, then you’re able to call this code with *this
 
@LucDanton I can, but that would mean writing what I anticipate to be a couple dozen helper functions. But this isn't performance-critical enough to be worth that mess.
Technically, it is performance critical, but this is in context of a lock and condition variable which is gonna dwarf the overhead anyway.
 
 
1 hour later…
2:24 AM
@PatrickM'Bongo done with ep2, very nice writing, okay gameplay
new jumping puzzle is… a bit questionable
 
2:34 AM
I liked it but it’s not going to appeal to a lot of folks, it’s too quirky (and buggy, but that’s something else)
I just noticed that c++1z relaxes explicit construction of scoped enums from the underlying type, e.g. enum struct foo {}; foo f { 42 };
 
Hello, Cruel World!
 
> There's been recent discussion about what assignments do with variants that hold references.
okay so they settled on variants with references first, and now they are getting around to deciding exactly how they should work
 
3:09 AM
Tor doesn't work in China
 
@Telkitty well set up own vpn server + Shadow socks or use the vpnexpress
anyway. you know it .right :P
 
I prefer existing Tor like software that works in china
Too lazy for too much extra work, after all I will only be here for 2 more weeks :p
Didn't know vpnexpress but will check it out
 
4:30 AM
@Telkitty forget then about HD video on youtube. because your speeds will be like 1-2 Mbps . but it's better forget about that stuff and enjoy the polluted beauty of china :P
 
4:56 AM
@LucDanton Is it worth mentioning in a resignation letter
@LucDanton In what cases?
 
all
oh, explicit construction means the_type { the_initializer } sorta syntax
 
@LucDanton awful
 
it’s not standardese
@PatrickM'Bongo I like the new map but replayability is fairly low, so probably not
@PatrickM'Bongo it makes "the_type { init } is the same as static_cast<the_type>(init), but without narrowing conversions" more accurate
for my money static_cast might as well be numeric_cast these days when it’s not an upcast
 
5:29 AM
And downcast
 
More {} constructor bullshit I don't understand.
More ways for C++ to fuck me in the ass.
"Implementation defined order", but {} is supposed to be an ordered initialization with arguments evaluated from left to right.
 
no
T{...} doesn't make the order left to right
it has to be an initialisation list like e.g. an array for it to do that
forgot the actual term for that :v
 
Well that's not helpful at all.
So since I don't have fold expressions,
I need to recurse manually to get what I need?
Aauugh fuck I do not want to use recursion just to make this bullshit work out aaahahahaahhhh.
 
@Rapptz initializer list? lol
 
yeah brace init list
 
5:44 AM
I thought the brace-init-list rules counted for constructors too?
 
@sehe I’ve noticed this
 
It's uniform initialisation and that's not ordered
 
Oh, it's called uniform init.
Welp.
Shit.
Sequence point definition and defined argument order definition can't come fast enough.
 
you mean it will never come
I'm pretty bored reading the standard
so I don't actually have a good answer
 
Apr 12 '13 at 9:51, by R. Martinho Fernandes
Within {}, order of evaluation is guaranteed.
stop being bad
 
5:47 AM
T{...} is technically using list initialisation
nou
I've been reading about python dicts for 2 hours
I think it is time to stop
 
Actually see 8.5.4/4
It should be ordered no matter the type of init
 
;~;
 
what standard are you using
 
I don't want to file a VC++ bug.
 
8.5.4 is for const auto& [x, y] = f(); for me
 
5:52 AM
Wait
8.6.4/4 on eel.is
 
> If the initializer is a parenthesized expression-list, the expressions are evaluated in the order specified for function calls - eel.is/c++draft/dcl.init#19
Shit.
 
How is that relevant
PhD confusing me as hell
 
This is for initializing a type T.
Although, it says parenthesized...
 
Get on discord it's very annoying to tell you you're bad on phone
 
:<
 
6:30 AM
So, it seems that Ping Pong is potentially a valid Chinese name when written with 平龐 characters.
Also, good morning.
 
user1804599
I just learned that tree scientists gather at /r/marijuanaenthusiasts because /r/trees was taken. I may giggle for weeks.
 
6:42 AM
hi @wilx, what do you mean by Ping Pong ?
 
6:57 AM
morning
 
7:22 AM
@wilx mawning
@wilx what do you mean with potentially?
 
@StackedCrooked I have never actually seen it as a name but if I believe wiktionary, first one is valid name and second is valid family name. :)
 
Ven
Hi
 
So are you guys gonna watch the presidential debate tonight?
 
it's pretty late in my timezone
I'll probably watch Stephen Colbert talking about it afterwards
 
Ven
7:32 AM
@jaggedSpire children cries
 
user1804599
@StackedCrooked I wonder what Trump does when Clinton collapses.
 
7:48 AM
Inflate, I suppose.
 
Stupid fucking iterator debug level 2 in unordered_map triggered some bogus exception that I have no fucking control over.
FFS.
 
Hi folks
 
user1804599
@ThePhD Uh how about you stop UBing
 
There is no UB in my program.
6
 
user1804599
Write good code instead.
 
user1804599
7:52 AM
> following are some string constants: "My name is Zoe", "Don't call me \"Chloe\"", this is a newline:\n", etc.
 
user1804599
these examples
 
Those constants are obsolete
 
user1804599
> We have made the present obsolete.
 
user1804599
"obsolescent" > "deprecated"
 
@ThePhD Famous last words... :)
 
7:58 AM
"Ping Pong" sounds strange to me as a full Chinese.
 
 
@wilx
 
I see what you mean, 'Ping Pong' is table tennis! @wilx
 
@DaleSong That is the obvious meaning. What I am marvelling about is that it is possibly also a valid person's name.
 
Ven
Yeah like many other languages.
 
Where did you see it? @wilx
 
@Ven but rubby's loops are very special
 
Ven
@BartekBanachewicz nope
 
the mere existence of the warning in that text is enough for me
 
8:08 AM
@DaleSong You are not paying attention. I have not seen such named person. But if you read the linked pages, they mention Ping as name and Pong as surname.
 
if your language is built in such a way that you have to warn about things like this, it's badly designed
plain and simple
 
Ven
It's the same in JS. It was the same in c# until like c# 5 or 6. It's the same in Python.
Perl gets away with it because it has actual lexical scoping not retardation.
 
I don't give a flying loop whether it's the same in Haskell or ML or whanot
the thing is bad
 
@BartekBanachewicz It seems to me, not knowing Ruby, that the problem is how is #{i} interpolated and when and not the for loop itself.
 
8:10 AM
the problem is that the language's design isn't very good.
it's a sum of parts that makes this situation terrible
 
Ven
rubby having flaws well I never
 
it's hard to point out at one particular design mistake that caused it; it's the overall effect that matters
@Ven I'm glad we agree. I guess I'm done here.
 
Ven
That was a pretty uninteresting discussion insofar I think everyone agrees every single language has flaws
 
Typical Bartek, one misidentified issue inflated thousand times...
 
Ven
"dynamic language have implicit variable declaration. it gives them retarded scoping"
 
8:12 AM
@wilx I am pretty sure I didn't misidentify this issue. It wasn't even identified by me in the first place.
but go on with ad hominems
 
@wilx Sorry. That makes sense.
 
Whatever, I don't care about the bad crap code VC++ is doing.
SHIIIP IT.
 
@Ven w/e how's life
I don't really care about ruby
 
> Warning: The inner portion of multi-machine definitions and provider overrides are lazy-loaded. This can cause issues if you change the value of a variable used within the configs. For example, the loop below does not work:
So it is not a for loop issue. IMHO.
 
Ven
are you doing this thing for work?
i thought you were writing jabbascript
 
8:13 AM
@Ven ye
@Ven Not anymore, not since I came back from Austria
I left the Node.js team there
 
user1804599
@Ven Lambda calculus is flawless.
 
@sehe Oh! It took me almost a day to see why this is funny. :D
 
<3 @rightfold
 
user1804599
No, I'm kidding.
 
user1804599
It's untyped crap.
 
user1804599
8:15 AM
give types
 
Ven
@BartekBanachewicz so what do you do nowadays?
 
@Ven I set up Vagrant boxes, duh :)
 
Ven
sounds very... fun
 
but really I'm in the pioneering research team
 
user1804599
PHP has good lambdas; they capture by value, not by name.
 
8:18 AM
we go out in the world and bring back the cutest and newest tech into our infrastructure
well, to monitor it, I mean
 
user1804599
99 is the newest tech
use it
 
and we use vagrant to isolate all those things and give them cozy little boxes
 
Ven
nice
 
it's about 10% coding, 20% vagrant, 50% reading and 20% additional development and tweaking in our internal tools
 
user1804599
write a vague rant about vagrant
 
8:21 AM
I could, in a few months I guess
I don't really know it well enough yet
 
user1804599
:D
 
and we're also Super Enterprise so we use Chef as well /cc @CatPlusPlus
but since noone really knows how to use chef yet either it's kinda fun
 
user1804599
let
  val xyz = (1, 2, 3)
in
  xyz.0 + xyz.1 + xyz.2
end
 
user1804599
AWESOME!!!!!
 
user1804599
8:25 AM
local
  val xyz = (1, 2, 3)
in
  val sum = xyz.0 + xyz.1 + xyz.2
end
 
user1804599
AWESOME!!!!!
 
user1804599
4/10 isn't a majority so it shouldn't happen.
 
user1804599
> A rest-of-file comment starts with the quadruple slash symbol (////) and extends until the end of the file.
 
user1804599
Aha, so that's why my ill-typed code compiled.
 
user1804599
8:30 AM
:v
 
Ven
:v
 
user1804599
And that's why the syntax highlighting was funny on GitHub.
 
user1804599
I thought it was broken lol
 
@R.MartinhoFernandes I... think they might be more Xenophobic than Americans.
That's.... that's amazing.
 
nwp
when I write temporary code to try something I should annotate it somehow so I don't forget it and leave it in
does one use something like //FIXME Testcode for that or is there something better?
 
Ven
8:45 AM
I use XXX
 
user1804599
@nwp bug tracker
 
nwp
@rightfold that seems way too much work for just testing something... but then again our "bug tracker" is not the most convenient
 
user1804599
@nwp #warning
 
nwp
VS doesn't understand #warning, so I guess I'll use `#pragma message("Testcode")
except it should probably say the file and line number
Off to the macro cave in procrastination land!
 
@johnregehr @spun_off I too can typically tell at a glance if code has undefined behavior. I say yes every time, and I'm typically right.
 
nwp
8:57 AM
@Griwes didn't he post that already years ago?
 
Ven
> June 14, 2016 at 8:43 AM
 
@nwp It's relevant to what @ThePhD said and it's pinned on Chandler's twitter. :P
 
nwp
guess my perception of time is way off
 
Ven
Learned a new form of SFINAE from @Guriwesu. I feel like an anime character who’s powering up with energy crackling all around.
Damn, @Griwes is selling the Lounge's tools.
On the other hand, that's more space for Luc in his bikeshed.
 
@ThePhD Depressing, the word you were looking for there was depressing.
 
Ven
9:05 AM
ohai borgy
 
nwp
I got it down to a #pragma TESTCODE that prints some all-caps warning and the file + line number
 
Ven
"unrecognized pragma"
 
nwp
I should probably use #error in release mode and then it's as good as it gets
#define S1(x) #x
#define S2(x) S1(x)
#define LOCATION "REMOVE TESTCODE AT " __FILE__ ":" S2(__LINE__)
#define TESTCODE message(LOCATION)
but I can't put the #error behind the #pragma and I cannot put the #pragma inside the macro ...
but it probably doesn't matter because the point is to make it fail to compile and I can totally do that
 
@Borgleader Nothing like a front row seat to misery.
... I think jagged's gotten to me. Either that or school has be depressed already.
I'm not even a month in. <_>
 
9:13 AM
@Ven What was it? @Griwes
 
@R.MartinhoFernandes typed enable_if with a variadic ...
 
Xeo
@R.MartinhoFernandes Check tweet replies
 
Bad c&p
@ThePhD Oh, boring.
Wait, what, STL didn't know this?
 
Xeo
Apparently
 
Two years ago he didn't know about SFINAE based on member definitions or w/e it was that P.J. Plauger showed him, so.
 
9:15 AM
@R.MartinhoFernandes Apparently, yes.
I was as surprised as you are now. :P
 
@LucDanton Oh. I had become so bummed out about Opera that I ignored all word of "competing" browsers by default. I'm having a look now
 
@Mikhail You misspelled "reich" :<
 
user1804599
@nwp lol
 
Your last example exists in the stdlib now, as std::enable_if_t, alongside various other equivalent helpers for other type traits. — underscore_d 14 hours ago
Too lazy to update my answer.
 
9:22 AM
enable_if_t is badware
 
C++17 makes the question moot.
 
The error messages start pointing at the alias definition, and not at usage.
@Ven lol
 
@ThePhD int main(){}
 
@R.MartinhoFernandes should add no_ub.c++ to that repo.
 
so opera browser is getting a thing again?
 
Ven
9:31 AM
@ThePhD :3
 
@R.MartinhoFernandes lmao /cc @Griwes
@ThePhD wait, what is the variadic for
inb4 "bartek shames himself for expressing his complete inability to use C++"
 
Xeo
@BartekBanachewicz So you don't need an argument of any kind.
Other versions: enable_if_t<cond, int> = 0 and enable_if_t<cond, int>... (has clang fixed that one yet?)
 
or enable_if_t<cond>* = nullptr
 
@Xeo Yes!
 
Xeo
Took 'em a while
 
9:38 AM
Richard Smith fixed it in February.
 
@Xeo wait so it's like we used to write = nullptr?
@milleniumbug IOW that?
 
The litb bug was updated like 5 months later.
 
is that really such a breakthrough
 
It missed 3.8, but landed in 3.9.
 
@BartekBanachewicz For me that has always been a workaround for clang not doing the right thing here.
 
9:39 AM
wow
y'all must be like really bored ;)
 
The variadic one works with and empty pack instead of a default argument.
Clang just ignored the argument on an empty pack, which is wrong.
 
correct me if I'm wrong but when/if concepts hit the stage it all ceases to matter anyway right?
 
@BartekBanachewicz anything to make you feel better
 
@sehe there was a smiley at the end :F
 
Xeo
@R.MartinhoFernandes *parameter, no?
 
9:41 AM
Maybe. Meh.
This sounds nice hub.github.com, though I wonder how much I'll actually use it.
 
@LucDanton first impression tells me it's not geared to the privacy sensitive
 
private Bear sehe
 
Ven
@JohanLarsson why did you titlecase that keyword?
 
c#, but you are right
 
Could anyone give me a hand making this compile? http://pastebin.com/0U2a4J0P

I am trying to make a function which sums the components of an array at compile time
 
9:49 AM
That code isn't going to do much at compile-time.
 
Even't if the std::array parameters is a constexpr? Anyhow I would like to know how to make that compile D:
 
@JoséD. multiple of "index" is "indices"
 
Nice, NERDTree has new cool features.
 
@BartekBanachewicz Multiple of "singular" is "plural"
 
9:52 AM
@BartekBanachewicz no, singular of "indexes" is "indice"
 
@JoséD. Parameters can't be constexpr.
 
@R.MartinhoFernandes sorry, I meant that I declare a constexpr std::array, which I then pass to the function.
 
@R.MartinhoFernandes Can't they? Thought they could
 
@BartekBanachewicz do you have any references for that? I htink both are acceptable
 
9:53 AM
And constexpr fncs can depend on constexpr args
 
@набиячлэвэли void f(constexpr int) isn't a thing.
 
Xeo
(shame that std::array::begin isn't constexpr)
 
constexpr != constant expression.
 
ITT nab cantexpr
7
 
Xeo
lol
 
9:54 AM
gud jok
 
Xeo
sup Andy
 
Ven
@набиячлэвэли no they kant
 
trying to survive stuff
u?
 
Ven
template<int N>
constexpr int sum(std::array<int, N> const& arr)
 
9:55 AM
Anyhow, why is this failing to compile, how can I fix it? godbolt.org/g/ttHnzh
 
Xeo
@Ven try it :P
(has to be size_t)
2 mins ago, by Xeo
whoo constexpr http://coliru.stacked-crooked.com/a/213e2636d8544c90
 
Ven
@Xeo bah! that's the same
 
@JoséD. The other function isn't a template. It won't be picked up by make_number< anything >(...).
IOW make_number<>(...) doesn't call the non-template function. Only make_number(...).
 
Oh, I see..
And how can I define the make_number<>(...) function?
 
f(...) can call both template and non-template functions. f<...>(...) only calls templates.
 
9:57 AM
@Xeo ...I think that was fixed by C++17, due to CWG's feedback for template<auto I>...
I'd need to check.
 
template <>
int make_number(const std::array<int, 10> &numbers) {
return 0;
}
does not compile
 
template <> makes a specialization.
You need a parameter there.
 
@набиячлэвэли heh
 

« first day (2172 days earlier)      last day (2761 days later) »