« first day (1924 days earlier)      last day (3038 days later) » 

12:00 AM
int x;
no_default_constructor y; // oops
float z;
std::tie(x, y, z) = something(); // oops
and yeah std::tie sucks exactly because it isn't a language feature
 
@Rapptz There's a lot of room between "not great" and "the worst thing ever".
 
I know
I like hyperboles. They're fun.
 
@Morwenn It does seem étrange if language features /use/ library namespace elements.
Maybe there are more things living in std:: that are actually core language features (some of the traits using intrinsics?)
@Rapptz Again, that's not std::tie's interface.
 
@sehe std::initializer_list
 
@sehe typeinfo is a weird one
 
12:01 AM
typeinfo too
 
@Morwenn Talk about bad interfaces too
 
have a keyword, but only if you include a header. dafuq
 
std::begin, std::end
 
are they proposing the non-const initializer_list thing?
 
Oh yeah. I tend to forget about the weird scaffolding under the covers of our pretty language :) (jk)
 
12:02 AM
@Rapptz and a number of exceptions (bad casts, failed allocations, etc.)
 
@AndyProwl IIRC they didn't move forward with any new std::initializer_list-related proposal.
 
@Morwenn TBH I don't that's used like that. I think it very deliberately uses unqualified begin and end (need to check)
 
Right.
 
@Morwenn dose puns. High density
 
12:03 AM
@sehe Not intentional though.
 
I recall it's doing the equivalent of using std::begin; begin(t); as well
 
@Morwenn It's impressive
 
std::tuple<T1, std::pair<T2, T3>, T4> f(); // lol
 
For a constructor, though, it makes sense to just use T, right? Like, my_class(some_other_class foo) : bar(foo) vs. my_class(const some_other_class& foo) : bar(foo)
Because you're going to copy/move anyway.
 
@sehe Anyway, there are already many overlaps between the core language and the standard library.
 
Ell
12:04 AM
if std::tie were a language feature, would you like a x, b y, c z = my_z, my_y, my_x; or a x, b y, c z = m_x, my_y, my_z; ?
 
@Morwenn Yup. Thanks for reminding
 
@sehe It's what you get when they decide to standardize every useful verb :p
 
@Morwenn dat pun
 
@caps that's what I've learned, except with Andy Prowl's adjustment (scanning code ftw)
 
@caps bar(move(foo)) though
 
12:04 AM
get<>(it)?
 
Aw...
 
Pleased to report I'm still good at hearing puns where none exist
 
@Morwenn verb sutter
 
It's good to excell at something in life
 
Wat. I tried to star my own message in the starboard .____.
 
12:05 AM
@Morwenn you're just that starable
 
@jaggedSpire Not as much as Cat.
 
@AndyProwl I sized that up, but I discarded it. PFINAI
 
:28289963 moveing the supplied parameter into the member constructor
 
@sehe help me with the final I
 
Pun Failure Is Not An Issue
 
12:06 AM
@AndyProwl Sutter's Bill.
 
ah
Sutter Island
 
:o
 
@sehe I'm not surprised my standards are lower than yours
 
Suttershy.
And Rainbow Bjarne.
 
@Ell I have not: I totally gotta try that soon.
 
12:07 AM
@AndyProwl Do you need to std::move if you pass to std::make_unique? Or does it get moved in the process of getting forwarded?
 
@sehe Yes. "otherwise, begin-expr and end-expr are begin(__range) and end(__range), respectively, where begin and end are looked up with argument-dependent lookup (3.4.2). For the purposes of this name lookup, namespace std is an associated namespace."
 
Ell
@ThePhD it worked for me :3
 
@AndyProwl I feel validated that my mind isn't too weird if you, too, picked up on that far fetched association
 
@caps if it's an lvalue and you want it to be moved, you have to move()
 
@Ell It answered [Y] to all the skip questions?
 
Ell
12:07 AM
@ThePhD yes
well, it answered yes to the skip test
which was all the rest of the file
 
@Ell Good enough for me! \o/
 
I should really be working on that proposal to weaken the iterator category of some standard agorithms.
 
@JerryCoffin Oh, so I shouldn't need to put std:: in front of begin and end?
 
@Lalaland For me, there's a form and it takes advisor approval. But, because I changed around my schedule a lot I'm not over 21 credit hours despite taking 7 classes.
 
@JerryCoffin That's actually very nicely expressed. It's conveniently forgoes the requirement of having std::begin or std::end declared at all. Just reserves the name of a namespace, really - which was a no-brainer already
 
12:08 AM
@AndyProwl Oh, interesting. I thought the compiler could tell the value's not being used after that and would insert the move.
 
@caps huh. It's about the specs of ranged-for
 
@caps This is talking specifically about what happens implicitly in the implementation of a range-based for loop.
 
@caps nope
 
I was fast only because my abuse of shorthand
 
@JerryCoffin Oooohhh. Okay.
 
@sehe Yeah--while I can certainly understand people's frustration with them, there really is quite a bit that they do really well.
 
One of the most tricky things about ADL is probably the fact that it doesn't kick in when there is an explicitly given template parameter.
Like, I don't think std::get is usable with ADL.
 
@Morwenn Hm?
 
@Morwenn Lies
 
12:12 AM
@Morwenn and with a parenthesized expression
 
^ that
 
I could be a prostitute. I'd rather be a nerd. ... wtf - obvious journalist don't study enough maths. Set theory says that you can be a prostitute and a hacker at the same time. They are not mutrally exclusive.
 
I know for ... well pretty darn sure that get<> works with ADL.
Using it with Fusion. And BGL. I would have notussed, right? Right!?
Darn peeps making me doubt everything every second
 
hmm I think Morwenn is correct but lemme check
 
It may be trickier than I thought it was.
But I'm pretty sure there are problems with ADL and explicit template parameters.
 
12:15 AM
 
This rings a bell
 
@TelkittytheWebDeveloper I'm more of a nerd, but I've been proposed money against sex often enough to also become a prostitute if I wanted to.
21
Q: getting an element from a tuple

fredoverflow Possible Duplicate: Why doesn't ADL find function templates? Calling get does not seem to invoke argument dependent lookup: auto t = std::make_tuple(false, false, true); bool a = get<0>(t); // error bool b = std::get<0>(t); // okay g++ 4.6.0 says: error: 'get' was not decl...

 
@sehe You probably have a using directive or declaration somewhere that lets you omit the qualification
> TL;DR I show how to build a modern C++ high-performance, asynchronous echo server that can be written with just 48 lines of code.
48 lines of code doesn't sound that few
 
Use coroutines an it takes 20 lines.
And 20 additional days to actually understand how the whole thing works.
 
ADL - the ugliest thing in my own opinion
 
12:19 AM
but ~elegance~
 
Ell
coroutines are the bomb
 
You obviously didn't watch the interview, lazy kitten.
That's a pretty inspiring interview. In fact I'm linking it again so people can star it without prejudice:
 
I like ADL.
 
I've not been bitten by ADL yet
it's going to happen though
 
I still dont understand why we need ADL
 
12:21 AM
@SashaMN basic_ostream::operator<< uses ADL
 
Hey, it's one of the few things that make namespaces more than name shorteners.
 
@Morwenn omg, and you didn't? why? :p
 
I use lots of namespaces and I've had trouble with ADL not working when I think it should. But it could be me doing it wrong.
 
@AndyProwl Not normally. I do admit that most often the Fusion use uses boost::fusion::at_c which I end up using explicitly for the obvious reason of bringing it into view. So, I'll read up again
 
those nice printing statements? You can thank ADL for their relative clarity
 
12:21 AM
@TelkittytheWebDeveloper Because I don't need money (yet) and men generally don't turn me on.
 
@Morwenn Me too. It's such a nice instrument for type extension and elegant code
 
It's cool when you do math.
That said, I have a friend who's somehow both a nerd and a prostitute. You can be both.
 
@AndyProwl It's very little for C++ standards. And consider doing it in C
We don't need it.
We don't need C++.
We don't need you.
Oh wait. That came out wrong
You catch my drift.
It makes certain things a lot more natural. Actually, ADL is a key enabler of OOP done right IYAM
 
12:25 AM
@AndyProwl Depends on how that's counted. Is it just executable lines, or is that the total including all the #includes, function headers, etc?
 
ADL is awesome when using Sean Parent's runtime polymorphism stuff.
 
@JerryCoffin it's everything
 
@EtiennedeMartel Another great band from Quebec.
 
@caps You mean, C++ (and probably meant static polymorphism, too)
 
12:27 AM
@sehe No, I meant what I said.
 
@AndyProwl In that case probably around a third (and maybe even half) is basically just syntactic noise, and the actual code is probably more like 20-30 lines. Admittedly, still longer than I'd like, but not particularly horrible either.
 
@sehe I do know the whole story. Just being sarcastic about the title's attempt at attention grabbing by suggesting someone would prefer to be a nerd than be a hooker
 
12:28 AM
@caps You really think I haven't watched that several times?
 
@AlexM. i love you too don't worry
 
@sehe I think you have watched it.
 
i just wanted to acknowledge jefffrey's new name
 
Even I have read the slides.
 
When you see the title you know what I'm talking about.
 
12:29 AM
@WGhost <3 <3 <3
 
And subsequently implemented a polymorphic vector with reference semantics.
 
hi
i've been delving into qt hard lately
 
@TelkittytheWebDeveloper I agree about the cheap attention grab (same goes for the still captioning). But you can see how the quote is not outrageous at all. I certainly reflects a decision she could make, at a certain time.
 
Pointing you at the video was faster than trying to put it into my own words anymore than I did.
 
my fav qt lib is uraqt
 
12:30 AM
@caps I didn't need that title for it. Sean Parent was enough. He doesn't really show any runtime polymorphism things involving ADL, AFAIR
 
hey sehe, u r a qt
 
ty bb And this, kids, is why you don't do alcohol
 
@sehe I guess I think of this as ADL:
    void draw_(ostream& out, size_t position) const
    { draw(data_, out, position); }
 
uhoh. dun dun dun
 
It calls a different draw function depending on the type of data_
 
12:32 AM
but there's 2 vs 3 args
 
@caps Oh yeah. That's fair. I didn't think of that as the quintessence of the pattern. But yeah, it's a nice touch (see:)
10 mins ago, by sehe
@Morwenn Me too. It's such a nice instrument for type extension and elegant code
 
@WGhost draw_ is a member function. Look at the code I linked earlier.
 
@sehe Can't say I like the syntax very well either. For work some time ago I had to write some code that was largely stringing together processing blocks like that. I overloaded | and >, so a lot of my C++ functions looked pretty much like shell scripts (initially though I'd need an overload of < as well, but never really did).
 
@sehe Well, I've had a lot of trouble with the compiler complaining it can't find draw for the types I'm trying to use. I think it's mostly a link-time and/or include issue.
 
Hi.
 
12:36 AM
@Nooble Hey :3
 
@caps I'm actually really puzzled, thinking about it now, about what issue it is, because I've fixed it in several places where I'm using that pattern over the past week, and I don't remember what I did in any of those cases. Except, I do remember a few cases where the solution was to move the helper functions into the global namespace. :(
 
could you accidentally be ADL-guarding the types?
 
@jaggedSpire It's entirely possible. What is ADL-guarding?
 
@WGhost You know what else you can delve into hard?~
TILDE TILDE TILDE.
@Nooble Evenin'.
 
Ell
@WGhost hi you have to test lounge<chat> soon^tm
 
12:40 AM
@caps define type in nested namespace, import it into another namespace. ADL considers the namespace where the type was defined, not the namespace where it's visible.
@ThePhD ~~~
 
@jaggedSpire "import"?
 
@caps using nestedNamespace::myType;
or using alias = nestedNamespace::myType;
 
@caps That looks to me like it probably doesn't use ADL at all. It would only involve ADL if the draw you're invoking is found in the same namespace as one of the arguments you pass was defined (and that wasn't the current namespace or one you're using, or anything like that).
 
@caps boost.range uses it.
 
@JerryCoffin For me it often uses ADL. I have namespace A { namespace B { class C {}; } } and I use A::B::C with that draw pattern in some class namespace D { class E {}; }
 
12:44 AM
@caps I think I came up with that pattern before I saw the talk (because I used variants quite heavily with Spirit ASTs). stackoverflow.com/a/18859931/85371 (the variant visitor) is an example using ADL;
There's alternatives though, stackoverflow.com/a/21492882/85371 here I used customization points (like traits classes).
 
@Ell Lounge<Chat> is still alive?
 
Just this week I ran across this new article contrasting different ways of making extendable APIs like this (comparing yet another approach): akrzemi1.wordpress.com/2016/01/16/a-customizable-framework
 
@jaggedSpire Oh. You know what. I am doing that in some cases. How do I make the functions that operate on nestedNamespace::myType available via ADL in the class that wrote the using alias?
 
Ell
@ThePhD not really, just a personal project
or un-project
depending on how much momentum I have
 
@caps declaring the types or the functions in a barrier namespace (and then "lifting" them into the target namespace using using)
 
12:47 AM
@sehe Hm. Example?
 
@caps using what?
 
@sehe using nestedNamespace::myType
 
@Ell Ahem.
 
@sehe accidental ADL-guarding
 
@caps That's the definition of ADL barrier IYAM
 
12:47 AM
Why am I not testing it.
 
In other words, using T1 does not declare T1 in the enclosing namespace.
It just makes the identifier visible. Meaning that the using-ed-in namespace is not an associated namespace.
 
@sehe I'll check these out. I like that Sean Parent's model thing moves the interface constraints into the user code instead of in an inheritance tree. I don't like that it still requires heap allocations (even though he says it doesn't? I'm confused about that claim)
 
I want to come to the uncon. I hope I will be available by then.
 
Ell
12:50 AM
@Nooble oh you're testing it too pal
 
@Borgleader <3
 
@caps However, you can do the inverse. Derive your type from template <typename...> struct adl_tag_base {}; and you can associate any number of special purpose namespaces! struct my_type: adl_tag_base<lib::fancy_operators::adl_hook, lib::serialization_functions::adl_hook> { ... }
 
tl;dr: C++ is powerful, but learning the details is a whole life project.
 
It doesn't if you have a variant implementation that doesn't.
Most variant implementations allocate (for exception safety IIRC)
 
@sehe What does boost::variant do under the hood?
 
12:51 AM
Everything. That's not a workable question
 
@sehe oh hey that's a neat trick that hadn't occurred to me. :) Thanks!
 
The problem with boost::variant is you have to know all the types when you make the class.
 
@caps Double buffer to make sure it has the strong exception guarantee.
 
I suggest you just read up on that. Like I would if I needed to explain
 
floof on a floof
 
12:52 AM
@sehe I mean, does it heap allocate?
 
@caps That's not the problem with Boost Variant. It's the definition of a variant
 
@Borgleader I am getting pretty tired of never playing any games with anyone though. If only there were some MMO someone were encouraging me to play...
I need to finish my present scarf inside of the next three weeks though.
 
@caps I already answered that
 
@Borgleader Haha, that's so cute x3
 
@Borgleader that is a beary tolerant parent
 
12:53 AM
@sehe You answered that most variants allocate, but I take your point.
@Morwenn So, so true.
 
:) I can search for the discussion(s) here and the proposals with their discussions. But I think you can too
 
and, I need to figure out how to make spaetzle without the maker tonight
 
@caps Well, Boost variant allocates and almost nothing else is used right now.
 
@Morwenn Right.
 
@Morwenn :D
@jaggedSpire hehehe :)
 
12:55 AM
@Borgleader Er, the proportions are not right :s
 
@Morwenn indeed, his smile is way out of proportion :)
 
I love telling how Boost is awesome when I never actually use it.
 
@Borgleader I should warn you in advance that I'm not what I would consider a power gamer, though.
 
@jaggedSpire Thats fine
 
@Morwenn It's so awesome the awesomess influences you only by existing
 
12:57 AM
@Morwenn So it looks like they were lies en.cppreference.com/w/cpp/language/adl
> Although a function call can be resolved through ADL even if ordinary lookup finds nothing, a function call to a function template with explicitly-specified template arguments requires that there is a declaration of the template found by ordinary lookup (otherwise, it is a syntax error to encounter an unknown name followed by a less-than character)
 
> > Use Boost! It's awesome!
> > Okay! What you you use it for?
> > *sweatdrop*
 
@Morwenn I hate telling how Boost is awesome even though I use it all the time
 
@sehe oh yeaaaah, that fucking nightmare of a nonsense. I remember playing with it a month or two ago, though I think I got confused at some point
it's useful don't get me wrong, but it's crazy also
 
using std::iter_swap is enough ADL for most people.
 
@sehe ... What is even that rule
 
12:59 AM
Most people are lightweights
@ThePhD nothing but fun!
 
@jaggedSpire It's not very hard. It's actually just very intuitive (you have to give the compiler something it can parse before it can start resolving things) /cc @ThePhD
 

« first day (1924 days earlier)      last day (3038 days later) »