« first day (750 days earlier)      last day (4191 days later) » 

Ell
10:03 PM
aww you gotta be ballsin me
 
sbi
@Ell Who are you talking to?
 
Ell
@sbi nobody in particular :3
just cursing aloud
 
Oh, so it's like vaguebooking. But in the Lounge and not on Facebook.
 
sbi
@EtiennedeMartel Yeah. Let's all plonk him, he's not talking to us anyway.
Now, this is serious shit. An official German authority (something like "customs criminal office") searching for programmers/admins that know how to do what should amount to writing trojans and harvesting informations from them.
 
The lounge is the only place I've heard the term vaguebooking.
 
10:09 PM
> Quellentelekommunikationsüberwachung
 
sbi
@EtiennedeMartel A monstrous bureaucratic word, even to Germans.
 
I'm starting to think you guys might be compensating for something with those long words.
 
@EtiennedeMartel that's a word
 
@bamboon Seems like it.
 
sbi
@bamboon It just means observing telecommunication at its sources.
 
Ell
10:10 PM
@EtiennedeMartel pretty much :D I copied a number down wrong :'( and it ruined my online homework score :/
 
sbi
Oh damn, you're a German, right? Sorry.
 
@sbi better late than never ^^
 
sbi
@EtiennedeMartel I seem to a remember a story by Roald Dahl about how women fall for long words, no matter whether real or made-up. A guy discovers this in them, and reveals it to a friend who wants to know how he can pick up so many women. To a German, that story was funny in its very own way. (I mean, what girl would fall for "Donaudampfschifffartsgesellschaftsversammlung"?)
 
Xeo
1
Q: How to enforce the 'override' keyword?

MehrdadIs there any way to enforce the usage of the C++11 override keyword in Visual C++ 2012? (i.e. if I forget to say override, then I want to get a warning/error.)

Wtf is going on with the close votes.
 
sbi
@Xeo Idiots.
 
10:20 PM
Is there a way to recurse into lambdas?
 
@bamboon std::function
 
Xeo
I flagged for removal of the votes.
 
@Xeo I'm ready to reopen that.
 
Xeo
Also, what does Hans mean with his comment?
 
sbi
@Xeo Good idea. Did so, too.
@Xeo Well, I think he believes override is not part of C++.
 
10:22 PM
@sehe hmm right thanks. let me see what I can make of it
 
Xeo
std::function<void()> f = [&]{ f(); };
 
sbi
@Xeo Ugh. Is this well-formed and UB-free? It certainly looks suspect.
 
Xeo
Yep.
Just infinitely recursive.
Well, once you call f for the first time.
 
Calling it for the second time is surely going to be UB :)
It would involve a second thread and the execution would at least be non-deterministic
 
10:26 PM
@sehe thanks
 
sbi
@EtiennedeMartel My cooking is one reason my mother enjoys visiting me. :)
 
sbi
@EtiennedeMartel On Friday evening I had friends of mine visiting (and the robot, BTW), and what we did was cooking one course after the other, and sitting down to eat them. In fact, they only left around midnight. I've been feeding my kids from the remainders all weekend, and there's still leftovers.
 
#MLG: y u no get better internet
 
@sbi Well, at least there's no waste.
 
sbi
10:30 PM
@Borgleader There's no user MLG here.
 
@sbi The MLG might be the biggest e-sport tournament in North America, they always have crappy streams.
 
Xeo
0
A: How to enforce the 'override' keyword?

Jonathan WakelyC++11 almost had what you want. Originally the override keyword was part of a larger proposal which also included the ability to enforce its usage: class A { virtual void f(); }; class B [[base_check]] : public C { void f(); // error! }; class C [[base_check]] : public A { void [[ove...

Aw, too bad really.
 
@sbi It's a hash-tag
 
Xeo
Not really an answer, though.
 
@sehe I changed it -.-;
 
Ell
10:32 PM
I don't understand why we need the override keyword o.O when is it ambiguous?
 
@EtiennedeMartel But I forgive them, they have hot chicks i.minus.com/iXikvNNY4lKeC.jpg
 
Xeo
@Ell It's a sanity check for the coder, nothing more.
 
sbi
@EtiennedeMartel That's still up and in the air. I only tonight found to packs of chicken breasts in my fridge that we had all but forgotten about (one bought by them, one by me). By the time we have eaten all the leftovers, they'd probably bad, so I ought to cook them while we have plenty of good food. Seems like waste to me.
 
Ell
oh right. java has it doesn't it?
 
@Borgleader evil edits
 
10:33 PM
@sbi First world problem?
 
sbi
@sehe Now it is, yeah.
 
@Xeo But certainly more informative than most straight-up answers I'd envision
 
Xeo
Aye
 
@sehe I realized it could be confusing here (following sbi's comment) so I changed it. No evilness here.
 
Jonathan Wakely, London, United Kingdom
9.1k 9 34
^ one creepy profile pic. And... Y SO PIXELATED
 
Ell
10:34 PM
wow, would you look at that. C++ following in java's footsteps. It's nice they get along now.
 
@Borgleader history editing is evil by definition
(I do it all the time - see?)
 
Xeo
@Ell Wat.
 
sbi
@Ell It's a real catwalk between overriding/overloading/hiding. The keyword would allow the compiler to tell you if you failed.
 
@Ell If you're talking about override, I think it comes from C#.
 
Ell
oh I thought it was java first
actually vb.net has it doesn't it?
 
10:35 PM
@Ell You didn't fail to notice that the proposal was stripped? Also, Java had @annotations for override and the likes at fiest
 
user406009
I just wish C++ would "steal" Java's wonderful build system.
 
@Ell Yes. All CLR languages are 'bound' to have it since the inheritance model is based on method slots
 
Ell
Doesn't java have "classpath hell" or something?
 
@Lalaland Cough. Wonderful?
 
user406009
@sehe Well decent at least.
 
10:36 PM
@Lalaland Agreed. Modules is gonna fix that :) We just don't know when. But the momentum is surely there to make it happen. Eventually
 
user406009
Better than C++'s ABI hell.
 
Ell
yeah the fact c++ doesn't have a standard abi sucks :/
 
Xeo
@Lalaland We'll never see a standard ABI for C++
 
sbi
@sehe Modules would fix that. (You do remember concepts, do you?) Well, in fact, let's make this "module might fix that" — because we remember export as well.
 
user406009
@Ell I have never experienced that. For me, Java "just works" in terms of libraries, plugins, the works.
 
Ell
10:38 PM
@Lalaland I have never experienced it really, I just remember reading about it somewhere I think
 
damnit
stupid shitty mailing list web interface ate my reply!
 
Xeo
@sbi Modules have an existing implementation, unlike export at the time it was accepted, and are not as big of a feature, unlike concepts.
 
sbi
@Xeo ConceptGCC.
 
Xeo
Never said concepts didn't have an implementation.
 
Ell
is concepts having "DefaultConstructible" and things to make template error messages easier to read?
 
10:40 PM
@sbi export was the stillborn sibling of modules, in a way. Sadly, 'export' was premature in too many ways to recount. If it had seen adoption, I reckon it would have gotten abused as a de facto Modules facility much like all the template metaprogramming rave was unanticipated. Hmm
@Ell Yup
@DeadMG Somehow I'm not sure you meant that positively ("the mailing list is eating it up!")
 
@sehe No.
I was writing a reply, and it came up saying "Would you like to read new messages?"
I clicked yes
then my reply was gone.
 
Ah. So. Who ate your message... It was a joint effort
Whenever I edit things in web pages I regularly ^A^C habitually. Much like I ^S, ^-Shift-S all the time. And @: in Vim (which may mean :w or :mak test depending current activity)
 
This answer needs to be deleted or something, the guy is clearly trolling
-1
A: Can I cast an array of POD which has floats to float*?

OswaldThe only guarantee that a reinterpret_cast gives is, that you get the original object when you reinterpret_cast the casted object back to the original data type. Especially, raw is not guaranteed to have 200 contiguous floats with the correct values.

 
Can you override moderator closes?
 
10:55 PM
I don't know
 
sbi
@Rapptz Nope. All you can do is flag and hope some other mod reverts.
 
Ah.. lame.
 
Ell
hmmm. Why did boost install into the wrong dir I wonder o.O
 
user142019
@DeadMG I added the extern "C" alias as an answer to your question, by the way. Not sure if you noticed it.
 
11:09 PM
I did
I'll have to accept that, because as problematic as it is, it's all there appears to be.
 
user142019
user image
2
 
user142019
^ Good Guy DeadMG
 
Ell
why does grep take so long? o.O
 
sbi
Yeah, but a proposed new feature takes years to appear in the standard, and maybe more to appear in your compiler — and takes a lot of lobbying. From what I have seen, the puppy hasn't shown overly much resilience against adverse circumstances.
 
user142019
@Ell because you’re grepping on an enormous amount of data?
 
11:15 PM
@sbi Library features which are feature-complete by Bristol are roadmapped to be Standardized in C++14.
 
user142019
@DeadMG You may want to call it __extern_c_fp because it’s in the global namespace.
 
the name's fairly unimportant
 
user142019
I know, but in your proposal it appears as if you want extern_c_fp to be usable outside of the library implementation.
 
user142019
I’m not sure if that’s what you want.
 
Ell
wtff still doesn't work! I have boost 1.51 or whatever
as well as the same compiler version as lalaland
 
sbi
11:22 PM
Please reopen this.
 
@Zoidberg'-- No, it's not.
 
user142019
@DeadMG In that case, the implementation fails if the user does this:
 
user142019
#define extern_c_fp
#include <functional> // whoops!
 
@DeadMg: what is the proposal?
 
user142019
Naming it __extern_c_fp prevents this, because you’re not allowed to define a macro named __extern_c_fp unless you’re the implementation.
 
11:25 PM
@Cheersandhth.-Alf It's for an interface to generate trampolines, so you can generate stateful function pointers (similar to what managed language does)
 
user142019
Besides that, the proposal looks good. Maybe you want a references section if you used any references.
 
@DeadMG like the old Borland hack of window function that stored a this pointer in EAX register and jumped to your member function (thus associating c++ object with the function)?
 
@Cheersandhth.-Alf I think so.
@Zoidberg'-- Well, I did explicitly describe it as a workaround, so I think it's given that I'd prefer it to be a member typedef or specified in the class.
 
Xeo
@DeadMG Good proposal, but... please accept a generic callable entity and not only std::function, since that will cause double-indirection when it's not needed.
 
but I did fix it
 
11:29 PM
i think that's interesting, practical also. maybe a bit challenging wrt. current security solutions. do u have link?
 
Xeo
Oh and I think you meant std::bad_function_call?
 
@Xeo That could (could) create significantly more implementation complexity.
@Xeo Yes.
 
Xeo
@DeadMG Why? Duplicate std::function internally and be done?
 
@Cheersandhth.-Alf How so?
@Xeo Yep. How else could you assign any two thunk<sig>'s?
 
well unless i misunderstood, would simplify all the back-to-c++-world-from-c-callbacks scenarios
 
11:30 PM
and secondly, if you always forward to a std::function, you can share the same binary code between every instantiation for the same sig.
 
but maybe i misunderstand proposal
since i haven't read it :-)
 
but if you forward to any type T, then you have to have new binary code for each T.
@Cheersandhth.-Alf It definitely world.
 
Xeo
@DeadMG Ah, I see where you're coming from.
 
Meh, can't sleep.
 
and I rather suspect that you could share the same binary code for every std::function, in fact, regardless of signature, on many common platforms.
but I don't know that much about these things.
 
11:33 PM
@DeadMG No, it doesn't, dammit. This is all the implementation complexity it creates: std::function<sig> some_private_member;. All that needs different code is the ctor. I told you this yesterday.
 
@Xeo thanks!
 
user142019
@R.MartinhoFernandes Just do system("shutdown -h now").
 
@DeadMG i think it's very much possible to cite Borland's work in I think it was called ObjectWindows (later VCL) as demonstrating soundness of principle
 
@R.MartinhoFernandes First day at work tomo?
 
11:34 PM
ohhhh
Hope you have fun :)
 
@R.MartinhoFernandes Right, but I don't get the point. Either you accept std::function directly in constructor, or... you pretty much have to forward it to a member variable anyway?
 
Hey there
 
user1174868
@DeadMG Have you watched MLG at all today?
 
I have, actually
 
Xeo
@Cheersandhth.-Alf Reminds me of my Delegate implementation with __asm hacks that did exactly that.
 
11:35 PM
fuck me, Life beat the shit out of Flash second time around
stopped watching after 3:2 Life:Flash, but hey
 
user142019
It can be implemented using compiler magic.
 
user142019
Like type traits.
 
Xeo
Oh, nvm.
 
user142019
That fake __thiscall hack Alf pointed out.
 
Xeo
__asm{
  lea eax, [this]
  call _fp;
}
It was something like that for me.
 
11:38 PM
@deadmg: it occurs to me that a simplest possible security friendly implementation would just allocate function pointers out of a fixed array of such. that would put an implementation-defined limit on the number of such extant at any time.
this would avoid the need for allocating executable memory (for "executable" security check)
 
user142019
I’m slightly confused about std::bound_function.
 
user142019
Is it something like function pointers with captures?
 
is exactly what it is
 
@Xeo yep. that's the old borland window proc trampoline trick. :)
 
you take an arbitrary stateful std::function, and produce a function pointer which calls that std::function, state and all.
 
11:41 PM
i guess the creator of C# was involved, the danish guy
 
user142019
@DeadMG AWESOME.
 
he was at borland at that time, doing borland pascal, before defected to microsoft :-)
 
@DeadMG There's no reason to require construction of two std::functions. There's also no reason to waste the one user-defined conversion there. And more importantly, there's no reason to prevent implementations from doing it without std::function at all.
 
@Zoidberg'-- right. why didn't anyone else think of proposing this, in all this time
pretty good work
 
user142019
With std::bound_function, maybe lambdas could be extended to be convertible to function pointers even when they capture.
 
11:43 PM
@Zoidberg'-- Nope.
then you get fucked on lifetime of the function pointer, effectively.
 
user142019
Oh yeah.
 
user142019
stupid_c_api(std::bound_function([=] () { ... })); :P
 
would be fine
 
user142019
What if the C API is asynchronous?
 
user142019
Or it stores the function pointer somewhere.
 
user142019
11:46 PM
In a hashtable, for example. And calls it later.
 
then you'll have to store the bound_function.
 
user142019
Ah yeah.
 
@R.MartinhoFernandes Aright, I changed it. Happy now? :)
lifetime control is the primary motivation for making it a class rather than a language feature
as language-level lifetime control which is not directly scoped means language-level GC.
 
@DeadMG Woot, I can sleep happy now.
@Zoidberg'-- As with any C API that stores pointers you give to it, you have to make sure it lives long enough by yourself.
 
man, that guy didn't quite seem to get the hint.
 
11:51 PM
Hehe, he just told you to fuck off.
 
yeap
 
I have an unfinished blog post about that "non-nullable-pointer resource" issue.
Maybe I should finish that.
 
what non-nullable pointer resource issues?
 
What you fixed with value_delete.
 
lol
 
11:55 PM
I implemented something similar.
 
Xeo
@R.MartinhoFernandes Not completely, his value_delete::wrapper isn't contextually convertible to bool
 
@Xeo Well, that was just an oversight.
> I hate Google's stupid messaging system. I have no idea why the thing stopped word wrapping everything after a certain point, but there's nothing I can do about it now except copy it and try again.
 
Xeo
Yeah.
 
lol, @DeadMG you're not alone.
 
@Xeo There's a couple other missings, I think- for example, the posted version can't be compared to each other. But they're readily addable
 
user142019
11:59 PM
std::bound_function<void()> foo{[](){}};
foo(); // this will also work, right?
 

« first day (750 days earlier)      last day (4191 days later) »