« first day (901 days earlier)      last day (4063 days later) » 

11:00 PM
Wait a second
Can I test whether or not an object has state?
 
@LucDanton Well, yeah, but false negatives :P
 
I.E. whether it has data member or not?
 
your mum's a false negative
 
16 mins ago, by R. Martinho Fernandes
You could maybe complain about them being empty types or not, but that is a different issue.
 
Ahhhh
std::is_empty it is!
 
11:02 PM
@LucDanton "non-union class type with no non-static members other than bit-fields of size 0"... bla bla - we love C++ for that, right
 
If you want to pursue that, just use a tuple for storage.
 
@sehe union {}; is not empty? wow :(
Eh, can't inherit from those and I think the wording doesn't cover union-like classes so it's all good I guess.
 
Dunno about MSVC but the ones in libstdc++ and libc++ already optimise away all the empty members that they can.
 
Really?
That sounds pretty badass.
 
bedtime
try not to murder each other too viciously
 
11:04 PM
> std::is_empty<T> and all other type traits are empty classes.
Sooo meta
 
lol
 
MSVC used to have difficulty kicking out as much EBCO as possible. Dunno how those flaws affect the tuple implementation, nor how much that changed.
 
@LightnessRacesinOrbit good night!
 
Aw man
 
I think they had to because of old compilers and supporting legacy code.
 
11:05 PM
I clicked that gif expecting something gross
 
@Walter thank you for replying! good night
 
You guys are such babies
 
@Rapptz It's disgusting. :S
 
At least, that's what I remember from a few connect.microsoft.com things.
 
@LightnessRacesinOrbit G'night.
 
11:06 PM
Yeah but it isn't as bad as most things I've seen
 
@R.MartinhoFernandes wait. kicking out EBCO would imply introducing non-needed class size?
 
Shock value I guess.
 
@JerryCoffin Ciao! BTW, I'd hoped you'd find my momentary impersonation of a compiler simply amusing.
 
@Rapptz I'm sorry 4chan & friends have weathered your soul. :c
 
I recommend you test it anyway. Assert std::is_empty<std::tuple<>>, std::is_empty<std::tuple<std::is_empty<int>>>, for example.
 
11:06 PM
@LightnessRacesinOrbit Gooood niiight.
 
@LightnessRacesinOrbit You should really have complained that show should also have been const! :-)
 
@R.MartinhoFernandes Wait, if it's empty...
.... How do I use it?
 
@ThePhD What is there to use?
 
@LightnessRacesinOrbit That would also not forbid them from holding rvalue references.
 
E.g. std::tuple<MyEmptyLambda> thetuple; get<0>( thetuple )( some, args ); ?
 
11:08 PM
@JerryCoffin I was going to moan about your keeping return 0; in there, but I couldn't find a realistic way to pretend I were GCC doing that.
@ThePhD Bye!
 
@ThePhD Works fine: there is no data to store...
 
o.0
I'm so confused >_<
 
@ThePhD The optimization is based on the fact that storing an object of an empty type does not need any storage.
 
global what?
oops, BYE
 
11:10 PM
Staay with uss.
<3
 
@LightnessRacesinOrbit Hard for an old dog to learn new tricks.
 
11
Q: Is there a valid C++11 program with the expression 'C++11' (not in a string & no preprocessor tricks)?

WalterThe name of the programming language C++ derives from the parent language C and the ++ operator (it should arguably be ++C) and, hence, the expression C++ may naturally occur in C++ programs. I was wondering whether you can write a valid C++ program, using the 2011 standard, containing the expres...

^^ lol
 
I think that's a dupe.
 
Someone downvoted it. :$
And again.
 
Ell
I forgot if anyone is mumbling
 
11:13 PM
wow... votes are all over the place...
 
@Ell Just visit Mumble?
 
Despite the question being dumb, I think that'd be fun to do
 
22
Q: Is editing the accepted answer with "This answer is incorrect. Please downvote it" allowed?

DaveShawI've just come across an edit to an accepted answer (link here), which adds the following to the top of the accepted answer: This answer is incorrect. Please downvote it. As Sardaukar's comment says, Visual Studio always blindly uses the last HintPath. Alex's answer is correct (please ...

^^ lol
 
@R.MartinhoFernandes It's a dupe of something Johannes asked here a month ago or so.
 
user142019
 
11:15 PM
@JerryCoffin Yeah, I found it.
 
user142019
Oh.
 
user142019
Apparently it's Flash that makes my fans go 3 kRPM.
 
user142019
T____________T
 
user142019
FUCK YOU FLASH YOU FUCKING PIECE OF DONKEY SHIT
 
Feb 24 at 18:13, by Johannes Schaub - litb
#if 0
   C++14
#endif
int main() {}
 
Xeo
11:17 PM
@Zoidberg Amen
 
llonesmiz, that you? +1 — sehe 10 secs ago
^ amazing
 
user142019
My computer sounds like a jet engine when using YouTube.
 
Xeo
I've been working with AS3 for 10 days now.
 
I can't believe I hadn't discovered this analysis of PHP until today.
 
Xeo
My impression is not good.
 
11:18 PM
My favourite item so far: "php_uname tells you about the current OS. Unless PHP can’t tell what it’s running on; then it tells you about the OS it was built on. It doesn’t tell you if this has happened."
 
@R.MartinhoFernandes why was this ever a topic. Twice now?
 
Xeo
But atleast I get stuff done and my boss will get me something nice as an extra thanks for helping out.
 
@KerrekSB It's great, read on. Full of gems. :D
 
Xeo
@sehe Because people like the obscure, obviously. Exhibit A: The smiley-expression question.
 
11:19 PM
@DomagojPandža I haven't laughed this hard all week...
 
@Xeo which people... :(
 
@Xeo Bastard.
 
Xeo
Still mad that I accepted your answer? :D
 
user142019
> "${foo[0]}" is okay. "${foo[0][0]}" is a syntax error. Putting the $ on the inside is fine with both.
 
user142019
Time to sleep.
 
user142019
11:20 PM
See y'all in my nightmares. I'll also invite PHP.
 
Xeo
So, I'm still pondering what I should ask my boss for. Attending the C++ Committee meeting in Bristol would be nice, but a week off is highly unlikely...
 
@R.MartinhoFernandes Lambdas - even ones without any kind of capture - still have a size, and thus don't qualify for shrinkage: coliru.stacked-crooked.com/…
So the size is always bigger than the actual T contained in property, even if all the types need not have any kind of storage.
MSVC shows the same.
 
Xeo
@ThePhD They're not required to have a size
And tbh, I don't see why they should have a size.
 
Well, sizeof on the property class shows 8 when using std::tuple, when before I could get it to be only the size of T (int, 4) if I could explicitly not store the getter, lvaluesetter, and rvaluesetter.
 
Xeo
In fact, check this ^
Nanners is awesome.
 
11:30 PM
@ThePhD All complete types have a size.
 
Put some complete in it.
 
@R.MartinhoFernandes Btw I know we throw around 'fuck final types' around but have you seriously contemplated how to deal with those, if it's at all possible?
 
No, I really I want to pretend they don't exist :(
 
posted on April 04, 2013

Last week, I discussed how optimization can sometimes mislead programmers into writing code that works better in the lab than in the field, perhaps because the problems that programs encounter in the field are larger than those that are used during testing. As luck would have it, since I wrote that article, I encountered a real-world example of that phenomenon.

 
11:34 PM
^ When you pack it into a tuple, and then a struct, it becomes a non-empty type.
Which is what I'm running into.
 
@ThePhD No.
What you are doing wrong is keeping the val out of the tuple.
 
Xeo
@ThePhD Well obviously.
 
The tuple cannot optimise itself to size 0.
 
Xeo
Try inheriting from the tuple.
 
So you get 4 for the int, plus 1 for the tuple (+ padding).
Put everything in the tuple, and the tuple will be 4 bytes, not 5.
 
11:36 PM
@Xeo Hey when we were investigating O(log n) instantiations, didn't we play around an optimized get for tuples?
 
Xeo
I think so?
 
Because if you have struct tuple<indices<I...>, T...>: element<I, T>... {} then template<int I, typename T> void get(element<I, T>& e); deduces just fine with GCC.
 
Xeo
Wasn't it something with abusing overload resolution?
 
Ell
I forgot what the mumble address was
 
Xeo
Well, or deduction.
@LucDanton Yep.
You'd probably want to disable deduction of I, though
 
11:39 PM
It would all be implementation details. You'd provide overloads similar to std::get as a front-end.
 
Xeo
Ye
 
(Oh yeah I have some silly catch-all templates constrained on is_specialization_of, time to fix that.)
 
Woops
Accidentallyy closed the lounge
In either case, @Xeo @R.MartinhoFernandes You were right, I had to pack it into the tuple: coliru.stacked-crooked.com/…
Now the size if 4, even with a lambda.
 
Also I want to make variant<int, void*> v = emplace<int>(); work.
 
@ThePhD As Xeo said, inheriting from the tuple works too: coliru.stacked-crooked.com/… (inheriting from an empty type is the trick tuple uses to optimise away)
 
Xeo
11:45 PM
@LucDanton Didn't you already have that through internal overload resolution to get the right type?
i.e., a bunch of int_<I> select(T); overloads?
 
Well I can do variant_type v = int();, yeah. But that's for conversions. Emplacing is for multiple arguments/default construction/actual in-place construction.
 
@R.MartinhoFernandes Which do you think would be cleaner? Packing it in, or inheriting privately?
Personally, inheriting privately looks pretty sexy.
 
Xeo
@LucDanton Oh, so only with exactly matching types?
 
@ThePhD Inheriting privately lets you keep one named member, but on the other hand you get the weird-looking get<0>(*this)...
 
Consider variant<std::vector<int>> v = emplace<0>(42);.
 
11:46 PM
Not really sure.
 
Xeo
Woah, wait. emplace<Type> or emplace<NonType>?
 
#define self (*this)
:3c
 
Xeo
(*this), you suck.
 
Both. Have yet to implement the former.
 
:c
 
11:47 PM
@ThePhD Ugh, at least do it right...
 
There, fixed.
 
Xeo
@LucDanton And for the emplace<Type>, should Type exactly match one of the types in the variant?
 
@ThePhD But doesn't really help there. The weirdness I mentioned is calling get<> and using the implicit conversion to base to get the tuple.
 
@Xeo Yes.
 
Xeo
That should be doable by fixing T instead of I for get and letting deduction do its work again, I think?
 
11:48 PM
@R.MartinhoFernandes Is that necessarily a bad thing when it's inside the class implementation, though?
 
Xeo
Or are you again not asking for implementation help? :)
@ThePhD It's annoying none-the-less
 
Yeah. What's with get?
 
I think the last time I did something like that I ended up inheriting from the full tuple anyway.
 
Xeo
@LucDanton ?
 
Mmh, I don't have a type version of TupleElement. And I don't mean passing TMP integral values.
@Xeo I don't get the fix T what now?
 
11:50 PM
Hm.
I could probably use a variadic constructor with this, couldn't I?
 
@ThePhD What for?
 
Xeo
@LucDanton With get(element<I, T>), you'd call it get<I>(*this), for derived-to-base conversion, right?
 
Btw, in the set(T&&), std::forward<T> is just a verbose way of saying std::move: T&& is not a universal reference here.
 
@Xeo I'm working with variant here. I don't even have an implementation of tuple.
 
Well, if I pack T and the getters/setters in the tuple, then all I have to do is forward: template <typename ....T> property ( T... args ) : getset ( std::forward<T>( args ) ... ) { }
But, I lose the ability to bypass the property and directly reference val.
 
11:52 PM
I'm kinda annoyed that I made my FindIf total by encoding failures with Int<-1>.
 
Xeo
@LucDanton You can still inherit from indexed_type<I, T> or whatever for the effect. But I think I'm going on a tangent here. I think I should ask this: What was your actual question about variant<int> v = emplace<int>(); again? (Sorry for being all over the place, I'm tired.)
 
There was no question. I just mentioned what I was going to play with.
 
Xeo
Oh
So I jumped to conclusions again.
 
Hm.
I wonder if I can union with std::tuple ...
 
11:54 PM
Oh gwa.d
 
It's just for education!
 
Xeo
Sorry @LucDanton. Just slap me next time I do this.
 
I suppose I could make FindIf partial (and SFINAE-friendly) again and change all the Conditional<Bool<(Search::value != -1)>, ... to Conditional<computes<search>, ... or something.
@Xeo Eh I wasn't really paying attention.
 
Xeo
Welp, so much for that then.
 
I need a better name than meta::computes though :p
 
11:59 PM
That was terrible, even for those that can understand it
 
Yeah I was going to ask about that.
 

« first day (901 days earlier)      last day (4063 days later) »