« first day (1145 days earlier)      last day (3793 days later) » 

9:02 AM
@rightfold that's amusing!
 
if (FileDate != default(DateTime)) Huh?
C# this is
 
@rightfold You should turn that into a question and post on SO: 'Why not replace logical operators with nested if's?
 
@TonyTheLion presumably making sure 0/0/0001 isn't shown as a date time
 
Is it wrong to go to a biz networking event and stuff your face with food? :'(
 
@TheForestAndtheTrees That is the default value?
 
9:09 AM
@Telkitty Wait. There is another reason you go to networking events?
 
... umm ... like networking?
 
@Telkitty What? Of course not. Chomp away!
 
actually nvm, there's no DateTime default constructor is there
 
I mainly go there to catch up with a few people
 
@TheForestAndtheTrees IIRC, it's value type.
@Telkitty They will be too busy eating the free food to talk to you much.
 
9:13 AM
I get roped in networking events regularly nowadays, why can't I be an unsociable piece of rock?
@MartinJames lemme tell ya the latest stories about meh pies ... I think you will be delighted to know ... :x
 
user1804599
Hmm.
 
user1804599
I need to control a printer on Windows programmatically but I have no idea how to do that.
 
@rightfold Hmm.. printers. Been a while since I used printer API. I'm pretty sure that I did not enjoy the experience.
 
One day I was feeding the two baby pies, the younger one was more daring so it got more food from us than the bigger one. When they were back on to the tree, the bigger one went on to a taller branch and tried to shit on the younger one ...
 
@rightfold there's a printer part of winapi
 
9:23 AM
@DeadMG Yes, there is :((
 
No.
 
sbi
@R.MartinhoFernandes Yeah, @Fred did just that. Caused all kinds of trouble here, as two people whose normal job consists of rushing from one meeting to the next already had their schedules shifted to meet him. I now look a bit bad, having suggested we hire such a censored.
:)
 
Xeo
@sbi Ow.
Mornin
 
sbi
Ok, I will have to work now. See you!
 
9:33 AM
morning robot
 
Yay! Someone commented on one of my singleton answers
 
hello
 
Fun fun
 
@jalf link
 
@jaif your answer is pretty good, but this line irks me: "Sometimes, it only makes sense to have one instance of an object. In which case you choose to create only one. You don't need a singleton to enforce it." Whenever people use this argument, I tend to think they've never developed with more than 2 people on a project before. You create abstractions and defenses because these things happen when people are working on different parts of a system and don't realize the interactions with parts they aren't working on. — user1748902 3 hours ago
 
9:34 AM
lol
 
ho ho ho, time to take some pop corns
 
@jalf let's call that Battle Royale programming.
 
@sbi I should probably stay out of Berlin for the next couple of years... sorry for making you look bad.
 
morning
 
9:36 AM
You fight your coworkers until only one is left at the end of the day.
 
> My argument is that "should a second instance exist?" is a decision that can only reasonably be made when the class is used, not when it was originally designed.
You should probably write it down somewhere.
 
@Jefffrey well, technically, I just did :p
 
That phrase, man. It could be the final weapon against the singletons.
It could save lives.
 
Xeo
@R.MartinhoFernandes Check the Asylum
 
heh
 
9:39 AM
@jalf What day (number) did you born?
 
@Xeo I'm not sure which joke I'm supposed to be laughing at here.
 
Xeo
The call traits.
 
@user1748902 If you need one instance now but possible more than one instance in the future, may I suggest the n-ton Pattern? It gives you the flexibility to change your mind later and create exactly as many instances as you need -- not instance more or fewer! — FredOverflow 6 secs ago
 
St jfbdh GB cjdndih SG djxjjdx
 
9:42 AM
Let's see if he takes the bait :)
 
Thesse people are so fucking annoying.
Suggesting this for C++14 is even morr ridiculous because we get polys
 
well, it's a million years too late for such features to get into C++14.
17 would be the earliest for any new features.
 
Even worse
 
@jalf, I've quoted you in my profile, hope you don't mind :)
 
Xeo
@DeadMG It's about the concept of call traits
 
9:46 AM
I agree.
just pointing out the irrelevant technical error :P
 
Xeo
I like std::invocation_type (or however it's called)
 
@DeadMG What features are you talking about?
 
Xeo
Since it actually takes your arguments into account to produce the called signature.
And from that you can do the usual shenanigans of extracting argument and return types, aswell as arity etc.
 
JBL
@FredOverflow Dat n-ton pattern...
 
@FredOverflow A non-feature some moron proposed on the Asylum.
 
Xeo
9:47 AM
But anything else is ridiculous.
 
Implementing it is one thing because your hands are tied, but suggesting for a language iteration while keeping all the flaws is just fucking dumb
 
@JBL Megaton pattern.
 
@JBL lol hard @ my own code, almost forgot about that "Zerotons are supported, too" part...
 
fuck fuck fucking debugger, why won't you break on assertion failure...
 
JBL
I think the best part is the "Industrial strength" in the title.
 
9:49 AM
@JBL It seemed like a good idea to make the question appear more serious back then :D
 
Xeo
more "serious"?
 
"Industrial-strength" sounds a bit BS (although I do understand what you mean, this phrase is mostly found in commercials). — fish Feb 2 at 15:47
 
@Jefffrey yay, I'm famous
 
Xeo
> [04] Only real men use naked pointers. Shared pointers are the right choice for softy men like you.
4
erm
 
@jalf What does "and then you get circular dependencies when one is attempted initialized" mean?
@jalf Also, in "It's so easy to just pull in a singleton, it acts almost as a local variable and all", did you mean global instead of local?
@jalf Also "You only have one GPU" is not necessarily true on modern hardware anymore.
 
9:54 AM
Gosh.
template <typename Callable, typename... Args>
auto make_stdfunction(Callable c, Args... args)
-> converted_std_function_type<Callable, Args...>
{ return c; }
This is so missing the point. SO MUCH WRONG
Fuck you @Xeo, why did you mention this.
 
Xeo
haha
yeah
 
I vote for this as douchey design pattern of the year. — user142019 Feb 2 at 14:18
Yes.
 
Xeo
@R.MartinhoFernandes Sharing the pain and suffering. ♥
@R.MartinhoFernandes Cue introducing all those traits just for that one auxilliary function :>
 
Xeo
Gosh fammit with these ~~~squiggles~~~
 
9:56 AM
Hahahaa, std::arity<variadic_template_functor, int, double> // 2
 
@FredOverflow your singleton logger needs to check with your singleton configuration object at startup, to determine where to write log files to. And your configuration object logs some information about where it loaded config settings from. Hilarity ensues
 
How useful!
 
Xeo
@R.MartinhoFernandes Like, "No shit, Sherlock!"
 
It supports polymorphic function objects that way.
 
JBL
@Xeo Where !
 
9:56 AM
ALSO FUCK TEMPLATE VARIABLES.
 
Xeo
arity<std::invocation_type_t<Callable(Args...)>>::value is about the only sensible version of that
 
So, his proposal supports polymorphic callables, meaning that you can only do pointless truisms with them.
 
@FredOverflow IIRC I did mean local. You call whatever::instance(), and you get an lvalue that you can do with what you want, and you can pretend that it came from a sane place, rather than a singleton.
 
Xeo
@JBL @Jefffrey's profile
 
I think that is approximately what I meant. Without actually having re-read my post :p
 
JBL
10:00 AM
@jalf s/a sane place/space/
 
Xeo
SPAAAAAACE
 
JBL
Oh right, the search & replace xkcd had an entry for space.
 
> Currently, when taking a callable type, by an unrestricted template, or when storing it using the auto keyword, one looses absolutely all information about the type,
WTF so much bullshit.
 
2
Q: In which cases is the C compiler allowed to ignore the calling conventions?

lxgrFor obvious reasons, a C compiler has to compile all functions that are externally visible to other shared libraries so that they conform to the platform's calling conventions and other ABI requirements. However, I've learned that it doesn't necessarily need to do that for functions that can be g...

nice question
"What would happen if a function pointer was passed to external code for a function annotated as being internal?"
 
@gnzlbg If you take the address of a function, the compiler is not dumb enough to remove that function.
 
10:06 AM
taking a pointer to a function prevents it from being inlined and if the function is not externally visible and you pass a function pointer to it to a different translation unit everything should still work
@R.MartinhoFernandes glad to hear that
 
@gnzlbg It doesn't prevent inlining.
It may prevent the compiler from not generating it, but inlining can always happen.
 
it prevents it from being removed?
 
@gnzlbg Inlining is not about removing functions; it is about replacing calls with their body.
It's about the calls, not the definitions.
 
yep but if a function is never called, it can safely be removed
 
But if you take its address, it can still be inlined.
 
10:08 AM
and if i never call the function pointer, it can also be safely removed
@R.MartinhoFernandes thanks!
 
Xeo
> Why Scala is the best language available today
lol
I remember the rant-blog from... yesterday?
 
Oooh, I missed a language rant?
 
@jalf I get that, but I simply cannot parse "when one is attempted initialized".
 
@R.MartinhoFernandes I just couldn't hold in my love for Scala.
 
10:19 AM
> The people who’ll likely be the users of this proposed extension to the standard library, are generally speaking library writers and other generic code developers.
Who are experienced C++ developers.
 
@FredOverflow "When you attempt to initialize one" + passive voice = "when one is attempted initialized" (or "when an attempt is made at initializing one") I guess?
 
@DeadMG Don't try to hold it in - let it explode. I'm sure someone will clean up the mess in aisle 4 afterwards.
 
JBL
So <windows.h> defines macros that prevents using std::max or std::min unless you define a constant NOMINMAX.
Fuck you MS.
 
they define a shitload of that kind of macro.
you'll just have to get used to it really.
 
JBL
Bleh...
 
10:25 AM
@JBL Microsoft's philosophy is that it's worse to break badly written 20 year old software, than breaking new, correct code
and then people wonder why everything on Windows works so badly
 
JBL
@jalf So much better being able to compile Windows 3.1 in 2013 than write new soft easily, yes.
 
@Xeo Can't you write something similar just about any programming language?
 
Xeo
Oh, and here is the "Scala is teh best thing evar" post: m50d.github.io/2013/12/04/language-design-is-hard.html
 
JBL
If Windows 3.1 was ever in C++, which I'm currently doubting but bleh.
 
Ugh, I'm posting too much on std-proposals already.
 
Xeo
10:29 AM
> on the camp that things this kind of thing
haha :)
 
@jalf Yes, bit it still works, (badly), after 20 years, assuming W95 or later. Mentioning Win3.1 is just unfair to any discussion about OS:)
 
JBL
@MartinJames It is unfair if I want it to be. There, Windows ME.
HA !
 
Xeo
> but std::function does not have a richer interface than the source
It even has a more limited interface in places
like equality comparision
 
@JBL 'ME' - OK, I fold:)
 
@Xeo Seems like there's too much context surrounding that.
 
10:51 AM
@JBL You can write (std::min)(a,b); instead.
 
@wilx No, not with macros.
Oh, wait, those ones yes.
room topic changed to Lounge<C++>: Can't even sleep peacefully now. [c++] [c++11] [c++1y] [no-answers] [no-questions]
 
@R.MartinhoFernandes (std::min)(a,b) is the canonical work around.
 
@Xeo This std::function abuse really pisses me off.
 
Xeo
Understandably.
@wilx #define U_NO_EXPAND // std::min U_NO_EXPAND (a,b)
 
10:56 AM
@Xeo Nice. :)
 
Xeo
(aka BOOST_PREVENT_MACRO_EXPANSION or something like that)
 
Isn't using (std::min) nicer?
 
JBL
@wilx Still annoying, but thanks for the tips.
 
I use (f)(x) often in places.
ADL is a bitch.
 
@JBL It is not only MS who does this.
 
Xeo
10:59 AM
@R.MartinhoFernandes That prevents ADL?
 
JBL
@Xeo #define Y_U_NO_EXPAND //Yes, why ლ(ಠ益ಠლ) ?
 
Xeo
TIL. Or I think I knew it before, but forgot.
 
JBL
@wilx Indeed, this is a bit more useful, thanks.
 
@Xeo I evaluates f on its own without arguments, so no argument-dependent lookup.
Don't ask me why it still works for overloaded functions.
 
Xeo
11:01 AM
name-lookup and overload resolution are different stages
 
I have had issues with AIX where thread is defined as (IIRC) a structure or such by some header and it breaks my use of the thread name when referencing it as a namespace component thread::Mutex. Instead I had to write log4cplus::thread::Mutex. This might be a compiler bug though. I have never investigated it further.
 
Xeo
(f)(x) only stops name-lookup through the arguments, I'd guess
 
@Xeo Yes, but the (f) subexpression has a magical type.
 
Xeo
so it can still perform OR on all the fs in scope
@R.MartinhoFernandes Hm, think so?
 
Yes. (f) alone is not usable.
 
11:03 AM
@JBL This should be #define U_NO_EXPAND_OR_ELSE // ლ(ಠ益ಠლ)
 
It's a subexpression that cannot occur outside the context of the surrounding call expression.
If that's not magic, I don't know what is.
 
JBL
Nipples.
Btw ADL is the next § I plan to read in the standard.
It's going to be great.
 
@Xeo It's almost as if (f) is an overload set expression that gets resolved "later" because it's called.
 
Xeo
@R.MartinhoFernandes Sure it's magic, but I was sceptical about the magic type thing.
 
@Xeo Well, what's its type for an overloaded f?
 
Xeo
11:05 AM
Actually
 
You can't name it, because there's no such type in the C++ type system.
 
Xeo
I think I'd approach it from a different direction
 
It's inference flowing in the opposite direction.
 
Xeo
Parenthesis are ignored normally, and it's ADL that's special-casing (f)
 
@R.MartinhoFernandes Pity you can't do something like auto x = (f);.
 
11:06 AM
@Xeo Where does it say they are ignored?
I don't recall any "remove extraneous parentheses" rule.
 
Xeo
Hm.. there is one for expressions, but expressions have a type...
 
AFAIK they are ignored because, well, they have no effect.
 
except for decltype and ADL. Well the effect may be implied (AST node changes from identifier to expression?)
 
Xeo
Lemme see if I can find anything in the standard
 
Look for "and". I bet you can find that
 
Xeo
11:08 AM
I vaguely remember reading something about parenthised expressions being equivalent to the expressions themselves
 
@Xeo Which leads us back to the same problem: what's the type of f?
 
Xeo
1 min ago, by Xeo
Hm.. there is one for expressions, but expressions have a type...
> A parenthesized expression is a primary expression whose type and value are identical to those of the enclosed expression. The presence of parentheses does not affect whether the expression is an lvalue. The parenthesized expression can be used in exactly the same contexts as those where the enclosed expression can be used, and with the same meaning, except as otherwise indicated.
 
@Xeo But this is one of those exceptions!
 
Actually, doesn't 13.4/1 forbid (f)(x) if f is overloaded?
 
WAIT
UEBERWEI­SUNGSGUT­SCHRIFT
NACHBEAR­BEITUNG KUNDENGE­LDER AUS xxxxxxxxxxxx ERSTATTU­NG ZUR GA-­VERFÜGUN­G VM 28.­09.2013 04 03 UHR DA GELD NICHT ENTNOMME­N,
11.11.2013
 
Xeo
11:22 AM
cool
 
They gave me my money back!
Two weeks later.
 
Xeo
haha
 
congratulations
who's "they" and why did they return your money?
 
@DeadMG Bank. Because I made a withdrawal at an ATM and didn't take the cash.
 
ah
 
11:24 AM
No, not two weeks.
More than a month later.
 
f(x) {
    return type {
        operator()() {
            return x();
        }
    };
}
z() {
    return true;
}
Main() {
    return f(z)()();
}
 
@DeadMG "GELD NICHT ENTNOMME­N," means "money not taken"
 
go me.
 
Xeo
@R.MartinhoFernandes You know, apart from the example in §3.4.2/1, I can't find any normative text that says why (f)(x) disables ADL.
 
@Xeo See definition of ADL. It's quite specific on which patterns trigger it.
 
11:26 AM
@Xeo "When the postfix-expression in a function call (5.2.2) is an unqualified-id"
 
(gdb) git status
Undefined command: "git".  Try "help".
(gdb)
Ooops.
 
I may be a bit rusty on C++ but it seems to me that 13.4/1 forbids (f)(x) when f is overloaded.
Oh
"Any redundant set of parentheses the overloaded function name is ignored"
 
@AndyProwl It works on every compiler worth any amount of trust.
 
Xeo
@AndyProwl unqualified-id doesn't exclude parenthesis, as far as I can tell.
 
@Xeo Yes, it does. Parentheses are in expressions, not identifiers.
 
11:28 AM
@R.MartinhoFernandes I know, which is why I was surprised
 
Also, welcome back!
 
Thanks! (btw hi guys)
Sorry I jumped into the conversATion just like that
 
Xeo
> A name “looked up in the context of an expression” is looked up as an unqualified name in the scope where the expression is found
hm
 
room topic changed to Lounge<C++>: Don't ever jump into conversions! [c++] [c++11] [c++1y] [no-answers] [no-questions]
 
11:30 AM
lol
@Xeo According to the grammar an unqualified-id is an id-expression, while ( expression ) is a primary-expression
 
Xeo
right
 
welp
write function returning T*... accidentally return false in a few places... compiler accepts :(
 
So in the context of (f)(x) if f is overloaded the type of (f) is the type of f which is determined by x, and the fact that ADL does not apply is unrelated
 
Xeo
evil implicit conversions
 
Boolean to T* - marvellous. Just what I've always wanted from a language.
 
Xeo
11:34 AM
At least the next standard fixes that
 
Fixes what?
 
Xeo
and only literal 0 constitutes a null-pointer-expression.
 
Oh, ok
 
Xeo
@AndyProwl false -> null pointer
 
huh, I'd have thought they'd have dodged that particular breaking change.
 
Xeo
11:35 AM
@DeadMG Chandler mentioned that at GN2012
 
Btw if I can get rid of my evil flu I will be at C&B next week, so in case you guys have interesting topics/questions I could bring them on
 
31 mins ago, by R. Martinho Fernandes
It's inference flowing in the opposite direction.
 
Right. That's overload resolution
 
nope, OR flows forward.
 
overloading is a situation where a system is subjected to a greater load than it was designed for
 
11:40 AM
C++ doesn't have any backwards-flowing inference except in a few very special cases.
 
"forward" and "backward" confuse me as inference directions.
I'd use "inside-out" and "outside-in".
@StackedCrooked Overload resolution consists therefore of adding support for larger loads.
 
A self-adapting system. Nice.
 
I suggest INNER and OUTER JOIN, (no, not really:).
 
operator T() is an odd one.
 
@R.MartinhoFernandes They're not inference directions, they're temporal directions, although I usually prefer to consider them the other way around. Forward inference is inference based only on what you've already seen. Backwards inference is based on information you might get in the future.
f(x) {
    return type {
        operator()() {
            return x();
        }
    };
}
Main() {
    return f(() => true)()();
}
yay me.
 
11:45 AM
Ugh, I don't think there's any notion of time needed.
 
(also, I implemented some simple short-form lambdas).
that feature was easier than I expected.
 
Which feature?
 
constant context.
i.e., references to parent scope objects that don't require runtime state.
types, overload sets, that kind of thing.
for user-defined types, I said that they are valid constant context if all their members are valid constant context, and they don't have any user-defined constructor/destructor.
it's basically akin to static members and nested typedefs, but a lot simpler.
 
12:04 PM
hmm, some guy randomly sent me three pictures of his legs.
 
@DeadMG He has three legs?
 
error: non sequitur detected
 
What, me? Making incorrect and/or unjustifiable inferences? Never!
 
Xeo
@R.MartinhoFernandes I like how that guy only responds to the integral_constant part of your rant :D
 
35
Q: Stack Overflow knows I am a robot and greets me in robot language

Martijn PietersBecause of a slightly flakey connection, I think I was just prompted to prove I am a human when trying to post an answer. However, although the dialog box popped up and the rest of the page was masked with an overlay, instead of the Flights of the Concords screenshot and the captcha prompt, the ...

^ nerds
 
Xeo
12:19 PM
Stack Overflow simply finally recognizes that all Marti?ns are Robots. Feature not bug. — Pëkka Nov 30 at 14:29
3
lol /cc @R.MartinhoFernandes
 
@Xeo xD rofl
 
Xeo
nom nom cheese cake
 
http://www.newscientist.com/article/dn24684-snakes-outpacing-other-vertebrates-in-race-to-evolve.html
Soddin' work. My snake has not evolved at all for days. I'm gonna have a reptile-dedicated weekend.
 
12:35 PM
Ugh
 
I found a Singleton
 
0
A: Suggest a question for the 2013 Stack Overflow User Survey

Lightness Races in OrbitDo you find Stack Overflow to be a net positive or a net negative as a learning/teaching/sharing resource on the internet in 2013, and why? Did you feel this way in 2012, or earlier?

@MartinJames It takes hundreds of thousands of years for snakes to evolve meaningfully...
 
@TonyTheLion OK, don't continue to look for another one.
 
So, you might want to take Monday off too.
@MartinJames :D
 
12:36 PM
@MartinJames lol
 
@DeadMG Are the legs hot?
Wait, it's a guy.
 
Xeo
@R.MartinhoFernandes Maybe they're burning?
 
@Xeo He replied to Zhiaho's message.
 
Xeo
Oh, true
 
@R.MartinhoFernandes I'm a guy, and my legs are hot
 
Xeo
12:38 PM
@LightnessRacesinOrbit Are they on fire?
 
@Xeo Yes baby
Wanna cam?
 
Xeo
Unfortunately, I'm at work
 
Use a CO2 extinguisher - the label on mine clearly states that it can be used on burning legs.
 
@LightnessRacesinOrbit LOL "What's the score?", "dunno - lemme check the seismometer".
8
 
yum yum
 
Err.. yeah, I prefer the cake.
 
I think most people would prefer the cakes ... but then again there are cannibals who prefer fat legs
 
I don't have any cake, but you reminded me - I have a pork pie in the fridge.
 
pigs can fly, mag pie in the sky
I was hungry but it's late so I had some pickles :(
 
12:50 PM
@Telkitty Not in Glasgow, aparrently :(
 
Hmm, can't IMAP login to gmail.
Is that just me?
 
hack it!
 
Not tried IMAP gateway.
 
@Telkitty Removed the message because you're afraid of being flagged away?
 
I don't want to hurt your feelings ... you know truth hurt :'(
But so does my trolls ... sometimes ... on weak people ...
 
12:58 PM
You're just an ass.
 
I just ate the best cheesecake of my life.
 
you cocksucker.
 
It just turned a shitty day into a great day.
 
I had some honey on toast and a small piece of cheese, and that's my entire food for the day.
 

« first day (1145 days earlier)      last day (3793 days later) »