« first day (528 days earlier)      last day (4646 days later) » 

18:00
Good, someone understands me.
@Potatoswatter she is often partly shrivelled, yes, after swimming
@Xeo hey, English is stupid, what can I say
Is there a way to use shared_ptrs with atomics?
Meaning?
18:01
There's an atomic API for shared_ptr, if that's what you want.
§20.7.2.5
@RMartinhoFernandes > Deswegen frage ich euch: Wollt ihr die totale Funktion?
@sehe What?
I don't speak gibberish.
you better don't understand it
@CatPlusPlus I mean, I want to reset (or assign) a shared_ptr instance that is shared by multiple threads.
And friends.
There are overloads for shared_ptr.
cppreference doesn't list them :(
18:04
@RMartinhoFernandes "Therefore I ask thee: Do you seek function, no-holds-barred?"
Does anyone implement atomic yet?
Paraphrasing Hitler "Wollt Ihr den totalen Krieg?" (Do you want to wage full-out war?)
@CollinHockey I think 5 nations do, the rest are bound by non-proliferation
@RMartinhoFernandes in German, it works rather well. Translation kills it
@sehe Nope.
India and Pakistan are not bound.
@RMartinhoFernandes But they are among the 5, so 'but' could still be technically used correctly.
18:07
@sehe No, they are not among the 5.
@RMartinhoFernandes Oh my. I'm a know-nothing then. I'll see whether re-education is still viable
@sehe it wasn't hitler, it was goebbels, to be historically correct
See ^^
(crawls to corner)
@sehe There are five states recognized by the treaty: US, Russia, France, UK, and China; India and Pakistan are not in the treaty but are known to possess them; Israel is not in the treaty, everybody knows they possess them, but officially they don't; North Korea withdrew from the treaty a few years back and made a successful test some time ago.
1
Q: Initializing a const instance member array

MatLet's say I have the class Foo. The following works fine: class Foo { public: const int* bar; Foo() { bar = new int[2] {1, 2}; } }; However, I tried to change this very slightly to use a template: template<int A, int B> class Foo { pu...

Can someone test this in clang?
Alternatively, test it in the standard.
@RMartinhoFernandes ASAP
18:20
@CollinHockey To answer the question: AFAIK: none
It finished building and I tested already.
wait, clang is on my home computer, not this one :(
You're a bunch of useless fools.
I have clang here, hang on
1 min ago, by R. Martinho Fernandes
It finished building and I tested already.
18:22
crap
Xeo
Xeo
@RMartinhoFernandes So... ?
What do you guys think of just::thread?
(Compiles without warnings for me on clang with -std=c++11)
Xeo
Xeo
@EtiennedeMartel Isn't that the std::thread library documentation, basically?
@EtiennedeMartel Is that the compiler/lib independent implementation of std::thread?
18:24
@EtiennedeMartel don't several compilers have thread now?
Xeo
Xeo
(and <future>)
@MooingDuck Indeed.
@EtiennedeMartel why would you pay for that?
Xeo
Xeo
@EtiennedeMartel I like the documentation. Didn't know about the lib, actually!
18:26
Honestly, I have no idea.
Xeo
Xeo
@MooingDuck Pre-C++11 thread lib?
Xeo
Xeo
That should've been a reply
Anyways, dinner time
@Xeo I guess if someone is afraid to upgrade to C++11 then it'd make sense...
Yeah, but if you need threads that bad, why not use Boost.Thread in the meantime?
18:31
@MooingDuck just::thread has existed for a long time.
@RMartinhoFernandes fair enough
It adheres very strictly to the standard because the author of the std::thread proposals and the autor of just::thread are the same person.
(He's also the maintainer of Boost.Thread)
@RMartinhoFernandes interesting
I just noticed C++ Concurrency in Action is out. I think I'll get it and start learning this stuff. I use g++ mostly.
How hard is it to get new libraries added to boost?
18:35
@emsr Same author!
@MooingDuck They outline the process in their site.
The guy is everywhere.
I can't get the stdthread.co.uk to load. Maybe I'm blocked.
@MooingDuck It needs to pass a review.
@RMartinhoFernandes During GoingNative2012 they mentioned how they wanted to add a lot more to their library, and compared C++ growth to C# and Java. I was wondering at the possibility of someone going through the Java/C# libraries namespace by namespace and adding similar libraries to boost. (Obviously rewriting everything, we don't want to bring in Java's problems)
I think GN thing was about creating a new project to be a de facto second standard library.
There's a network library in the works already.
18:38
Which'd be shipped with compilers and whatnot.
@RMartinhoFernandes Wait. Is just::thread and stdthread.co.uk by the same guy?
What else is in Java or .NET?
@emsr Yes.
2 mins ago, by R. Martinho Fernandes
The guy is everywhere.
@CatPlusPlus I can't find anything on GN, what's that?
He likes threads.
GoingNative, you silly duck.
18:39
@CatPlusPlus I'm going to pretend my job is distracting me from making that association
@CatPlusPlus we already have boost, just add it to boost. And convince MSVC/GCC to ship with boost
@CatPlusPlus Understatement of the week.
Hell knows what they're planning.
Here is a Google proposal for thread pools: open-std.org/JTC1/sc22/WG21/docs/papers/2012/n3378.pdf Looks interesting.
What we need is a standard version of TBB.
Or Microsoft's concurrency runtime thing.
@EtiennedeMartel I believe it is already there. concurrent::vector and stuff. need to look it up @Robot?
18:44
Yes, generic thread pool would be nice.
@RMartinhoFernandes msdn.microsoft.com/en-us/library/dd504870.aspx is what he's talking about.
Ok, what is in .NET: plugins (needs at least some kind of modules), collections (already have that), DB access, drawing things with GDI (uh?), dynamic language support (yeah, right), locales (already have that, no one uses?), I/O (already have that), LINQ (right...), networking (there's a boost library in the works), big ints, reflection, speech recognition/TTS, regex, threading (got that), timers (got that), XML. The rest is Windows- or .NET-specific crap.
@MooingDuck there isn't much interesting there.
New I/O framework would be nice.
You forgot about TPL.
Xeo
Xeo
18:46
@CatPlusPlus Totally
It's a pretty big part of .NET 4.
@EtiennedeMartel Concurrency Runtime and PPL (Parallel Patterns Library)
@EtiennedeMartel Oh, that's in threading.
Yeah, threading needs higher-level constructs.
We already have primitives, yes.
Xeo
Xeo
<future> is a good start
But one day I'm going to get serious and make some sort of LINQ-like thing.
Xeo
Xeo
If the coroutines thingy gets through, that's another step forward
@EtiennedeMartel Boost.Range, you mean?
Xeo
Xeo
Hehe
Damn it.
Boost steals all my ideas.
18:47
Intel is also pushing for language (i.e. keyword) for thread support. I wonder if we could wind up with several confusing styles of thread support. Ugh.
@EtiennedeMartel You mean the idea you wanted to steal from .NET.
one comment allowed per 15 seconds? Didn't it used to be 5?
Details, details...
@emsr You mean like C# 5 is going to do?
@emsr Only if they stupidly accept more than one proposal.
Why didn't my Wikipedia link onebox?
18:48
@MooingDuck Votes/edits one in 5 seconds. Comments: one in 15s
@EtiennedeMartel It's not like C# 4 has one single way.
@Prætorian Chat can't handle multiple hot potatoes.
Xeo
Xeo
@Prætorian https
... https
Xeo
Xeo
Damn
@RMartinhoFernandes Well, it was your pet peeve, so no wonder you recognized it instantly
@RMartinhoFernandes Why multiple?
18:50
@Xeo HTTP is one, HTTPS is many.
Plural '-s'
@RMartinhoFernandes Yeah, starting in C# 5/.NET 4.5, we'll have: low level threading primitives (System.Thread), TPL, and async/await C# keywords.
(yes, I know the T and the P don't match perfectly)
Each being built on top of the previous one.
@RMartinhoFernandes Evidently! Too bad, I can't easily get a non-https Wikipedia link because of the HTTPS Everywhere extension
18:50
Hot topato.
Xeo
Xeo
@RMartinhoFernandes Err, "potatoes" is already plural
@EtiennedeMartel Plinq?
@Xeo Hot potato?
@sehe Oh, yeah, but that's part of TPL, IIRC.
Vs Hot potatoes?
18:51
@CatPlusPlus You say potato, I say potahto
@EtiennedeMartel What about the old AsyncBegin/AsyncEnd model?
Hmm. Yeah.
And I have the feeling I'm missing another one.
@sehe You say potato, I say your mom.
Come to think of it, .NET has plenty of ways to make async stuff.
Soooo, yeah, I don't think we're gonna make C++ that much more complicated with new keywords.
18:52
@StackedCrooked Ouch, don't make me laugh. I hurt myself sneezing this morning
Terrible back ache since then, I can't laugh
Or sneeze
user457812
I've been hurting my shoulder by sleeping on a couch at my parents' place for spring break. I'm really not sure how.
@sehe That must be funny to look at. Hi hi ouh! Hi hi hi ouugh!
@StackedCrooked Yeah yeah, my colleagues thought so
@sehe How on earth do you hurt yourself sneezing?
@je4d Try doing it too close to the wall.
18:54
@StackedCrooked Aw god, I meant:
@CatPlusPlus You say topato, I say topahto
There's this old saying that goes like this: it's all fun and games until somebody gets hurt. Then it becomes hilarious.
3
I was getting dressed and continually sneezing. Picture yourself with your arms twisted inside a shirt and then being surprised with a hefty sneeze.
That happened.
@EtiennedeMartel Ouch, ow, ow, stop it!
Lounge<C++> goes slapstick.
My coffee tastes like somebody sneaked crack in it.
@sehe well I'm glad laughing doesn't make me hurt at the moment.. because that's the funniest thing i've read all day :)
@sehe but I can sympathise; I had a bone graft taken from my hip once, it made laughing/sneezing/breathing painful for weeks
18:59
Why did you have your arms twisted inside the shirt?
The robot always has the best questions.
@RMartinhoFernandes he was getting dressed. I assume that's related somehow
Oh, so that's how he dresses.
@MooingDuck No, that doesn't explain anything.
19:00
@je4d Wow.
@RMartinhoFernandes Wow
@RMartinhoFernandes Wow?
The worst thing was during dinner, my daughter made me laugh, I was by reflex saying 'Ow' and subsequently choking on my food. Of course that triggered more coughing...
I bet there are worse conditions. My wife has a hernia, so this is peanuts and only temporary (I hope)
@RMartinhoFernandes I'm so happy I'm not the only one slightly bewildered by this C++11 'improvement'. I'm sure I'll be putting a subset of this to good use, but really, most of it is 'meh' at best in my view
@sehe I can certainly picture myself with the arms twisted inside the shirt, but it doesn't look at all like I'm getting dressed.
@RMartinhoFernandes ? It looks like you missed you medication and people protect you from yourself?
Something like that, yeah.
@RMartinhoFernandes I assumed he meant t-shirt rather than a dress shirt... if you've got your arms twisted in a dress shirt, YDIW
It could have been that I was reversing sides of the thing or something else entirely (I don't consciously remember my morning rituals, I'm kind of an evening person). Regardless, it hurts. I remeber that part
I don't like buttons. I'm a keyboard user
But if it is of any consolation (what's the word: geruststelling) it was a T shirt
19:10
As for enums: ideone.com/itFuz
Screw built-in ones.
@EtiennedeMartel I like how that page reecursively invokes TVTropes as an example
@CatPlusPlus That's missing operator==.
> TV Tropes. Not being able to make head or tail of a trope example referring to very Story Arc- or 'verse-dependent events from a show, book, movie, etc. that you are not familiar with, when it is not put in context for those who are not familiar with it, and is described using lots of in-jokes, meta-references, and ambiguous sentences hyperlinked to other tropes that are self-evident only to the familiar, is one of the most entertaining and infuriating aspects of this wiki.
@RMartinhoFernandes Quick'n'dirty prototype.
I want that kind of thing built-in.
19:14
@CatPlusPlus (a) you're not Xeo (b) did you inspect the generated code to see whether it is efficient?
I'm thinking what'd be the best way to add iteration over enumerators there.
It's as efficient as any other variant.
@CatPlusPlus Why do you need the static_visitor?
some_enum's size is 8 here.
@CatPlusPlus I'm sure that boost variant has a typetrait thingie that exposes the typelist as a mpl sequence
boost::variant AFAIK doesn't allocate dynamically.
19:15
Q. How many Prolog programmers does it take to change a light bulb?
A. No.
6
@CatPlusPlus Not unless there is a recursive wrapper
@StackedCrooked To avoid type-switches.
Enums are never recursive, so that's not a problem.
@sehe what's not-being-xeo got to do with it?
@CatPlusPlus I know, I was just complementing the info
@je4d I'm expecting that kind of template wankery from Xeo more than the cat
@CatPlusPlus (Ab)use ranged for?
@sehe There's no template involved!
(well, the static visitors, but that's far from wankery)
19:17
@RMartinhoFernandes Well, that's at least doing the truth full justice
Ok, ok, but it was my first response. If it doesn't make sense, think of it as an obscure Matrix reference.
I'm convinced you guys will even find a Trope for obscure Matrix references. Win win.
Ah, operator== is taken care by implicit size_t conversion.
Not sure if that's the best way, but still.
Doesn't hurt to be explicit.
@CatPlusPlus Ew.
I was expecting the conversions to be explicit in a suitable compiler.
@CatPlusPlus Btw why are user-defined operator= and copy constructor required?
19:23
There's no copy ctor.
Oh, never mind.
operator= is apparently not needed.
@RMartinhoFernandes "what does a hen weigh?"
O my god, this looks like fun:
codebetter.com/gregyoung/2012/03/27/charge-for-bad-code [Charge for bad code/Mighty Moose re-licensing idea]
Oh.
@MooingDuck I wasn't expecting it to be that lame.
19:24
@RMartinhoFernandes I had to read it twice before I got it
Damn, this one question led me to take the Google Code Jam exercises … friggin’ waste of time
@CatPlusPlus that seems overly complicated
took me ages to get the T9 thingy right because I hadn’t read the output formatting specs properly :(
@KonradRudolph lol
What's overly complicated?
19:27
@CatPlusPlus your enum
I would never have guessed.
What's complicated about it?
It's a frakking enum.
boost::variant doesn't constexpr.
@RMartinhoFernandes ow. a non-constexpressible enum. could be useful
I'm reading a Cracked article about serial killing animals and there's an elephant in it. DF was right all along.
DON'T LINK TO IT.
19:32
Meh, I need enum-to-string conversion more than constexpr.
You don't need boost::variant for that.
But it looks nice. :(
I don’t get why your values are different types …
Hi -- what's a good approach for an "annotated" tuple type, where I associate a string with each member?
@KonradRudolph To fit into boost::variant.
> When the hero jumps up from the earth, its real speed is greatly increased, although the same face (50). How to make that speed was the same and when you touch the ground and without?
-3
Q: Rated speed is not equal to the real

SinbaWe use Box2d. The ball moves around the earth (horizontal line). Friction = 0. Ball have enough big horizontal speed (50), and 0 vertical speed. Problem: When the hero jumps up from the earth, its real speed is greatly increased, although the same face (50). How to make that speed was the sam...

19:34
And ideally also an identifier, like with the enum trick: std::get<field>(x).
@RMartinhoFernandes Isn’t it rather the other way round? b::v is needed because the values have different types …
Enum is a tagged union of data-less types.
But I have the impression the variant is the decision factor.
@KerrekSB I've needed that exact functionality and I wrote something from scratch for it. Although with constexpr I suppose you could store a key -> index lookup table and use get<lookup(field)>(x) with a regular std::tuple.
19:36
hmm
I like data E = A | B | C :(
@CatPlusPlus Yes, but C++ does not have ADTs.
@LucDanton I struggled for quite some time, with all C++11 bells and whistles...
boost::variant is a tagged union.
@CatPlusPlus Well, but distinct types isn’t the only way to implement a tagged union
and neither is b::v
19:37
I don't want to implement a tagged union, I want to implement an enum!
Basically I want some sort of network protocol message type that I can define easily: ADDFIELD(int, header)
then do it
Then I want the entire message object to be able to do stuff generically by recursing over the fields (so making them a tuple would be the natural idea).
But I also want to refer to each field by an identifier (like x.header), and I also need a textual version of the field name (like "header").
@KerrekSB My own requirement was easy communication with Lua, with protocol-like table description. So that seems somewhat similar.
@LucDanton Did you include named field identifiers?
19:39
@KerrekSB Yes, and they double as their own textual representation since they are references to char arrays.
@LucDanton Sounds exactly like what I need!
Do you have that somewhere?
I'd still consider the lookup table + tuple solution though. Seems somewhat simpler than what I have, which makes my hair stand on end from time to time (macros...).
@CatPlusPlus What's wrong with class my_enum { enum class secret { foo, bar }; constexpr my_enum foo = secret::foo; constexpr my_enum bar = secret::bar; /* ctors, to_string and shit */ };?
@CatPlusPlus Hey, you're spamming my Bitbucket feed!
19:42
@LucDanton I think you can't get past the macros, because you need to somehow make the program know about its own identifiers.
@KerrekSB The source is here, but you may want to see what using that looks like in the unit tests.
The problem with the lookup table + tuple is that it cannot be authored in a single-touch way. If you want to add a field, you have to touch many lines of code, non-locally.
The DEFINE_SUPER_CONSTRUCTOR macro is completely separate and a workaround to GCC not having inherited constructors by the way.
@LucDanton I'm an active user!
@LucDanton Ah, but you need to define the field names separately?
19:44
@KerrekSB That is in fact one of those things I'm not too happy with: I first need to define a field name, then describe a structure I'm interested in.
In my usecase I'll have hundreds of message types, so ideally I wouldn't have any global namespace pollution for field names
On the other hand, one name can be shared for different structures. Even though I would really have liked to have get<"foo">(t) to be possible.
But most important is the ease of writing client code.
And of not having to repeat oneself.
@LucDanton Yeah, that's true...
@KerrekSB I haven't used my own solution for too long, so I'm still struggling to see if there's a convenient way to make usage sensible. E.g. at the moment I'm checking if having the field names defined in anonymous namespaces makes sense.
Basically, I want to take something like this: ADDFIELD(int, foo); ADDFIELD(float, bar);, and turn it into:
19:47
@RMartinhoFernandes formatting :P
lol
There are two static missing, too.
enum FieldIDs { foo, bar };
static const char * FieldNames[] = { "foo", "bar" };
std::tuple<int, float> data;
Should I post this as a question?
And then I summoned a henway.
If you're not afraid of macro-heavy solutions. One of my motivations was that, too.
@RMartinhoFernandes What did I say? :-)
@LucDanton I'm convinced that macros are inevitable!
Since I only say foo once and want both an enumerator and a string constant to pop out.
I was even looked at UDLs, a la Field<int, "foo"_fn>. but no luck.
Templated UDLs are only allowed for integral types.
19:51
You're not the first one to hit that wall.
Field<int, 'f','o','o'> would be one option, but then I don't get the enum out.
@RMartinhoFernandes People with trunk GCC builds don't count :-)
@RMartinhoFernandes By the way, even release-4.7 is ICE central...
@LucDanton Are you saying you'd post an answer?
@KerrekSB Oooh, do you get those where if you add stuff to a TU then it suddenly breaks with no reason? And if you move the code you just added to another TU then everything works?
@KerrekSB I'm not sure.
@LucDanton No... I got one with gimple bmove something something
I've not been able to fix it
short of making the TU with -O1, but then the resulting program segfaults.
Mmh, that could be serious.
This is an existing project; I just switched the compiler version.
19:53
I'm switching to clang as my primary, anyway. (Hear that @Xeo? Do I get a prize or something?)
I really don't have a good feeling about 4.7. No aspect of its life has made me feel safe.
Xeo
Xeo
@RMartinhoFernandes lol
@RMartinhoFernandes I may need to ask someone to walk me through making Clang work with a Standard library implementation (any implementation), but I'm afraid that if I ask how you did it you'll say you just used the package manager.
@LucDanton hehe.
So... time for an SO question I suppose
19:55
Does anyone else think Programmers is a site for frustrated Stackoverflow users?
I do need to hack the PKGBUILD scripts to make them work sometimes.
@karlphillip No, Meta is.
While I can install pretty much anything from the package manager, sometimes it involves pain.
Xeo
Xeo
@LucDanton It's relatively easy to get Clang to work with libc++
19:57
@LucDanton (Right now, I'm actually fighting with libcxx-svn)
@KerrekSB Humm, nah, I think Programmers is a better fit.
@Xeo Can't remember if I even attempted to build libc++.
And by "right now" I mean for the past two hours or so. And by "actually fighting with" I mean chatting and reading TVTropes.
Xeo
Xeo
@LucDanton $ cd lib && ./buildit
Does libc++ have debug iterators and the like btw? And other precondition checks?

« first day (528 days earlier)      last day (4646 days later) »