« first day (850 days earlier)      last day (4323 days later) » 

11:00
maybe his name really is Smithundalle? :/
template<typename F, typename R>
iter<F, R>
concat_map(F& f, R& r)
{
    return iter<F, R> { [&f, &r](typename iter<F, R>::caller_type& yield)
        {
            for(auto&& x: r) {
                for(auto&& y: f(x)) {
                    yield(y);
                }
            }
        }
    };
}
Xeo
Xeo
@R.MartinhoFernandes Apropos mail, I just noticed our Redmine tracker still sends all ticket notifications to "[email protected]".
It really is cheating, isn't it? :p
@LucDanton Yeah, that looks like SelectMany in C#.
11:01
I don't know LINQ. Did I do something wrong?
It's correct. SelectMany is the right thing.
Oh wait you mean how you can implement it with those coroutine-like features? It looks similar?
Xeo
Xeo
Can SelectMany only unnest a single layer?
11:03
(And I choose the easy way with those ref-capture only because I can't perfectly store F. Otherwise it's not a problem, but I can't write inline.)
@Xeo you can nest SelectMany...
@R.MartinhoFernandes Is there some magic higher up that computes TResult?
hello
@LightnessRacesinOrbit Why not? Looks 100% valid to me. I suppose to a person who is confused about main it may not look valid. — Lundin 4 hours ago
is there a way to renew my last question?
11:04
@LucDanton It's all inferred.
This guy thinks that freestanding implementations can have a void main return type. They can't. Right?
Xeo
Xeo
@LucDanton It comes from the selector.
i have completed it few minutes ago, but none seems to consider it
Xeo
Xeo
@LightnessRacesinOrbit freestanding can do whatever they want
Generics are not as complex/powerful as templates, so you get a lot more inferrence out of it.
@LucDanton wow - power code
i suspect that's because it was made few days ago
@LightnessRacesinOrbit it's implementation defined anyway.
@Xeo Just recurse.
Thought in C# I would build such a thing from scratch and not on top of SelectMany.
Xeo
Xeo
@R.MartinhoFernandes Yeah, but you need to do that manually.
11:06
@LightnessRacesinOrbit : Freestanding implementations may have nothing for main to return to.
(can you read me, it's the first time i write in this chat)
@R.MartinhoFernandes Altogether I'm actually fairly optimistic regarding a non-coro implementation (at least better than 'it's easier with a GC', which I find quite pessimistic). I'm wont to write 'heavier' ranges than is idiomatic in C++03 though.
@Xeo Of course you need. It's a building block. And a very fundamental and powerful one as I explained already :P
Really I make the assumption that I can afford to move :/
Xeo
Xeo
Yeah, still, I kinda expected it to recursively flatten the sequence all the way.
11:07
@MichaelFoukarakis It is implementation-defined whether they provide a main, but that doesn't mean they can provide a main of any form they choose
@Xeo If you're using a type system that's interesting to express actually. I think.
@Xeo That is less powerful (challenge: write the non-nesting one on top of that nesting one).
Xeo
Xeo
Hm
@LucDanton Well, if you ever end up writing it, plink me :)
@BartekBanachewicz How does the rep from writing a book matter? I don't care if the book is rotten. He still doesn't need toy rep on the cover
11:08
> [C++11: 3.6.1/1]: A program shall contain a global function called main, which is the designated start of the program. It is implementation-defined whether a program in a freestanding environment is required to define a main function.
> [C++11: 3.6.1/2]: An implementation shall not predefine the main function. This function shall not be overloaded. It shall have a return type of type int, but otherwise its type is implementation-defined [..]
@R.MartinhoFernandes k
The first bold passage does not override or cancel out the second.
@melak47 Osom. Buy it nao.
@LightnessRacesinOrbit Yeah that's correct, I'm probably confused with C.
@MichaelFoukarakis I think this dude is, too. Unfortunately, +22!
11:09
@Xeo I hope you are not actually trying it. You can't.
@sehe You put it on blog, you put it in CV, why not on the book (back)cover?
@R.MartinhoFernandes osom? lol
Xeo
Xeo
@R.MartinhoFernandes That was more of an acknowledging "hm".
Ok. Just making sure I didn't send you on a fool's quest wasting time.
Dammit, I feel like thecosh today.
@sehe All that's missing is the iter alias, which here ends up being something like boost::coroutines::coroutine<Ref()>. Ref being the range_reference of the result of calling F on a range_reference!
@Xeo Wait, do you do that often?
Xeo
Xeo
11:11
@LucDanton Moreoften, it's "Mhm".
I always thought that was more of a pensive 'furrowing my eyebrows' thing.
Xeo
Xeo
But I've used just "Hm" before.
@LucDanton That would be "Hmm"
I'm not counting those m's!
Xeo
Xeo
:D
@LightnessRacesinOrbit There are a lot of answers like that whenever the tags C and C++ appear together, and unfortunately that happens a lot.
11:12
@Martin edit will be enough to bump it up the 'active questions' ranking. I must say I noticed the question yesterday, but the title is instant turnoff for me ("X does not work")
@MichaelFoukarakis Yeah :(
@BartekBanachewicz Who is "you" here?
@MichaelFoukarakis Actually I might write a separate answer for C++
@sehe hypothetical book author
Is for(auto&& y: f(x)) yield(y); really appropriate? What if move iterators are involved?
for_each makes a comeback, dun dun duuuun!
11:14
I don't want to ponder that now.
@BartekBanachewicz I'd put it in none of the three places
Xeo
Xeo
@LucDanton yield(std::forward<decltype(y)>(y))?
@Xeo you are all talking about things I don't understand and that's making me feel uncomfortable inside my own head.
I'd rather use for_each, is my point. Less error-prone.
0
A: Why is the type of the main function in C and c++ left to the user to define?

Lightness Races in OrbitLundis is correct about C, but in C++ the wording is sufficiently distinct to make a difference: [C++11: 3.6.1/1]: A program shall contain a global function called main, which is the designated start of the program. It is implementation-defined whether a program in a freestanding environment ...

Make that famous, my little C++ soldiers.
user142019
11:16
I need a simple todo app with notifications.
@sehe Well what's the linkable image for then?
@Zoidberg iCloud reminders is very good imho. So if you have an iDevice, you already have it
Xeo
Xeo
@LucDanton How so?
Is there some kind of thingy I can acquire to alleviate pain in finger articulations?
user142019
@BartekBanachewicz I have about four. :P
user142019
But no Linux is meh.
11:17
@Xeo Assuming a polymorphic functor, you'd receive an rvalue assuming move iterators.
user142019
Oh well.
Xeo
Xeo
@LucDanton And how exactly is that different from having to handle potential rvalues in the ranged-for?
2 mins ago, by Luc Danton
I'd rather use for_each, is my point. Less error-prone.
@Zoidberg well have you ever opened Reminders?
Xeo
Xeo
I still don't see the "less error-prone" point.
11:18
@Xeo for_each forwards everything perfectly without him even thinking about it.
Oh wtf, apparently there is a zip in Boost.Range. It's not documented, but it's not part of a detail namespace. The worst is that it's called boost::combine.
2
user142019
@BartekBanachewicz yes very often.
user142019
But it's not for Linux so meh.
Xeo
Xeo
@LucDanton wtf
WTF
@LucDanton lolwut. I thought zip was one of the few that had a more or less standard name.
user142019
11:19
I should write my own but I won't complete it.
@Zoidberg now I understood that part. :P what about iCloud, it has web interface, and last time I've checked it worked on Linux
Well the ticket reporting that was opened 11 hours ago so depending on how the resolution someone can file a request for a better name right after.
@Zoidberg I can incorporate you into one of my projects if you want to finish something. Or you might report to me if you think it will help you make something complete.
user142019
Just a daemon that reads a text file I can edit with Vim and extracts timestamps from them and notifies when those times occur. That would be great.
Xeo
Xeo
@R.MartinhoFernandes Ah, he'd just do for_each(f(x), yield);. I kinda thought he'd write a functor for the for_each.
Also, you don't handle x being a potential rvalue.
11:21
@Zoidberg that's deceiveingly simple
user142019
@BartekBanachewicz but it works and it works well.
Come to think of it, with polymophic lambdas, ranged-for is only necessary if you need non-local returns.
Comes from another range-for so same problem, same solution. Hence why I provide functor versions of my tuple algorithms!
@Zoidberg how do you know if it works if you haven't written it yet?
Xeo
Xeo
@R.MartinhoFernandes if you have boost::for_each
user142019
11:21
@BartekBanachewicz >_>
@Xeo It's a one-liner anyway.
user142019
HOW DO YOU KNOW A CAR WORKS IF YOU HAVEN'T MADE IT YET?
Yeah, for(auto&& x: r) f(x); amirite? :D
user142019
It works in theory.
3
@Zoidberg well then, have you used such tool before?
11:22
@R.MartinhoFernandes What? You mean, moving them hurts?
@Zoidberg I personally love it
And you don't need non-local returns if you have the range-trio-of-power.
Xeo
Xeo
@LucDanton lol
@R.MartinhoFernandes lol
@Zoidberg That's something I call engineering.
11:23
@Xeo WTF indeed
¬_¬ I work with too many people with the same name
seriously, there is a small army of guys with this same name
It's not like they test drive bridges now, is it?
@thecoshman s/two/too/. Also, with
user142019
@thecoshman that sounds very wrong.
user142019
For very wrong definitions of "work".
11:24
@sehe Yeah, after much typing, I assume.
Well, not only moving. It's just generally painful.
@R.MartinhoFernandes Perhaps a stress ball?
@Zoidberg He's like a neuron network applied on english sentences. It doesn't always make sense, but it can sometimes produce funny results
@BartekBanachewicz thanks... I think
@R.MartinhoFernandes better keyboard?
@thecoshman I wasn't insulting you openly :)
11:26
@R.MartinhoFernandes adopt a different technique. see a fysio therapist. Seriously, you need those limbs
Type less. Think more :0
Those are some valuable appendages indeed.
Thanks for the correction :)
It wasn't meant to be.
That's why I accept it
> A limb (from the Old English lim), or extremity, is a jointed, or prehensile (as octopus tentacles or new world monkey tails), appendage of the human or other animal body.
Is fine!
11:29
What have you tried?
i tried ifstream and ofstream. — Dahoshi 10 mins ago
*sigh*
@sehe I have felt no pain from typing in three years, and it only happened today, so I might be overreacting. But I do value my hands and don't want to waste any time making it worse.
@R.MartinhoFernandes stop typing then?
@thecoshman Stop plinking me, then!
11:32
@LightnessRacesinOrbit where did that come from? She also looks 12
@R.MartinhoFernandes stop reacting then
@R.MartinhoFernandes well, my take on this is: take it easy as soon as you feel pain signals. It works for me. I have recurring problems with my wrists, and using this simple methodology keeps it under control.
I think I'll take some time around lunch to make my German homework.
Xeo
Xeo
TIL STL is on SO.
3
Of course, you can't always avoid typing at all, but you sure as heck can stay away from documenting, refactor-fests, mouse a little more, type in shorter bursts, consciously relax in between, mouse more (yeah, I know, that's painful, but it sure allows you to vary if it's mostly for navigation). And yeah, change keyboard/sitting position etc. helps vary as well
@Xeo For a month now. I think that means he started on ~2013-01-01?
@R.MartinhoFernandes 'make'?
11:36
Oh yeah, it's never writing the range that's the problem, it's writing the iterators.
@Xeo he clearly cares little for it :P
@LucDanton I'm having flashbacks.
@thecoshman how can you tell?
I've written my own zip_iterator because the Boost one sucks, I've seen you suffer, and yet I still forget.
tuple_type iterators;
bool is_end_iterator = true;
Makes me so sad.
Yep, totally a flashback.
@thecoshman Oh well, it works in German (with "machen"), so I'm netting this as a win. :P
11:41
@R.MartinhoFernandes ¬_¬ you're a strange little man
Xeo
Xeo
Damn, I just noticed there's a new Core C++ video.
What is that series about?
@R.MartinhoFernandes Core C++?
@R.MartinhoFernandes something like Core J**a, maybe
@Abyx J**a?
Java?
11:47
@thecoshman J**a.
> This stuff [initializer lists in stdlib] will be available in the next public release [of VS], whenever and whatever that is
Xeo
Xeo
@R.MartinhoFernandes What, didn't watch it? channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Core-C-
DefaultConstructible is only required for ForwardIterator. Is that new? I thought one of Input/Output needed that.
@BartekBanachewicz so much for their claim to push new features and updates to the existing version, I guess (unless "next public release" refers to these updates)
@Xeo No, I don't have infinite time, man. I am already constantly shuffling free time around to get what I want done.
AFAICT it's also a useless requirement!
7
A: Use std::initializer_list in Visual C++ Compiler November 2012 CTP

Stephan T. Lavavej(I work for Microsoft and with Dinkumware to maintain VC's STL.) [sharethis] I am not sure if it could be caused by the fact that I am (sadly) using the German edition of Visual Studio and the compiler update is in English. Unfortunately, the English-only CTP does not support German VS. T...

/me resists the urge to tell STL off for calling it "VC's STL"
Xeo
Xeo
@LightnessRacesinOrbit Your rampage against the usage of "STL" is just silly by now.
@LightnessRacesinOrbit I think you can give him a lifetime pass on that.
11:51
@Xeo Why is it more silly now than it was before?
@R.MartinhoFernandes I don't have a choice
@LightnessRacesinOrbit I love how you always manage to look at the same stuff at SO that I do
@BartekBanachewicz good innit
like me you have a good eye for shite
I don't know if I should treat this as a compliment
Anyway, time for a hunt.
how does boost take care of loading/linking the libraries it needs itself? #pragmas?
@R.MartinhoFernandes Actually I have no idea what's the category of the result should be. Can it be better than SinglePass?
@melak47 Boost code refers to libraries in the same way that your code refers to libraries
@melak47 Except most Boost code doesn't refer to any libraries at all
@LightnessRacesinOrbit what I mean is..I don't have to tell my linker to link boost_filesystem-vc110-mt-1_53.lib
11:58
@R.MartinhoFernandes Yeah that's not the right time to badger you with that is it?
Xeo
Xeo
@melak47 For MSVC, I think so.
@Xeo ah. alright
@LucDanton "Can?" Maybe. Not sure. Probably not worth it, though.
I think it can be multipass.
@melak47 Maybe for VS they use #pragmas, then. Look at the source!
Beyond that I don't think it is very useful.
12:01
@LightnessRacesinOrbit nah, I'm okay :p
I suspect there is a lazy vs eager tradeoff here. (Also you have to consider how fat you're okay with the ranges being.)
@melak47 VS has pragmas for linking.
@R.MartinhoFernandes First thing that came to mind is sorting a container of container.
@R.MartinhoFernandes The question is "does Boost use those pragmas?"
@R.MartinhoFernandes yeah, I know. I was just curious if boost used those
12:02
whether
> #include <boost/config/auto_link.hpp>
@LightnessRacesinOrbit Yes. There's a macro for it, and I think it comes on by default.
@LightnessRacesinOrbit :D
@LightnessRacesinOrbit hunt means killing stuff to get food.
@BartekBanachewicz does it count as hunting if you kill the people in the checkout line ahead of you so you can checkout your groceries?
> # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
12:03
@LucDanton Sorting by moving stuff across the children?
when you follow the trail, which takes all of forty seconds, you find that the answer is "yes"
Looks like a very weird use case (i.e. why not just one container)
@LightnessRacesinOrbit okay okay that's enough detail. I didn't want to know more D:
@R.MartinhoFernandes Yes.
It does sound fucked up as hell to implement.
12:04
> Forty is an octagonal number
where do they get this crap
mathematicians
@R.MartinhoFernandes Yup. I'll forget about it.
TIL python tutorials don't use fixed font. Now kill my eyes.
Not sure about the iterator-pair-travestis, but I know Andrei's ranges can do that without a lot of effort.
Mittagsessen. Later.
@R.MartinhoFernandes No doubt. Store functor and input range, lazily compute as needed right?
I'm slapping iterators on top of that, the usual.
Xeo
Xeo
12:07
@R.MartinhoFernandes Guden
12:23
(removed)
> En trop grandes quantités, le poivre rose devient toxique : une douzaine de graines par plat est une mesure raisonnable.
I was wondering what was in my cheese.
@LucDanton Woah.
@LightnessRacesinOrbit that's SO, not me
I've heard of that pepper before, but never knew that.
Pepper always sounded innocuous to me. As it turns out, it's neither a pepper nor innocuous.
@BartekBanachewicz (removed)
Xeo
Xeo
12:27
lol
@LucDanton I'm still wondering what was in your cheese
A pink peppercorn (French: baie rose, "pink berry") is a dried berry of the shrub Schinus molle, commonly known as the Peruvian peppertree. Although a peppercorn is the dried fruit of a plant from the genus Piper, pink peppercorns came to be called such because they resemble peppercorns, and because they, too, have a peppery flavour. Dried berries from the related species Schinus terebinthifolius (the Brazilian pepper), are sometimes also called pink peppercorns (baies roses de Bourbon). The dried berries of that shrub are employed as culinary spice. In 1982, the Food and Drug Administra...
@LightnessRacesinOrbit damn
Article kinda sucks, I would otherwise have quoted it.
> The United States later lifted the ban.[when?]
heh
dammit
someone's going through all the Android posts and removing tags from titles (yay) but I only have 20 votes to accept the edits
and other "people" are rejecting them
user142019
12:33
liftM ban :L
can someone help me with some C#->C++ conversions?
@Zoidberg There is a lift you know?
1662: Pierre de L'Ancre's vivid account of the Devil's penis: "a half-yard long", dark in colour, bent acutely and "very rough in texture".
@historyweird is amazing.
user142019
@R.MartinhoFernandes yes but I don't know what it does.
user142019
12:45
I have never used it.
Lifts computation from inner monad to the transformed monad
@R.MartinhoFernandes What methods were used for measurement, and what were the deviations in the results? Were there any controls? Is there a paper?
@MartinJames Guy wrote three books on witchcraft.
It's in one of those.
user142019
runMaybeT $ do
    liftIO $ do
        x <- readLn
        return . lift $ something x
user142019
That??
user142019
12:47
Assuming MonadT IO. :P
@BartekBanachewicz well, it was kinda linked to in chat. Miraculously, more people follow the same links :)
@sehe nah, don't break the mystery around it
@LucDanton Sounds healthy
Don't worry, it was a Brie aux 5 baies, so like a fifth of the pepper in it is that pink peppercorn. I'll probably make it.
12:52
@R.MartinhoFernandes Except, it's not history. Unless all my fantasies are history too
Pierre de Rosteguy de Lancre or Pierre de l'Ancre, Lord of De Lancre (1553–1631), was the French judge of Bordeaux who conducted a massive witch-hunt in Labourd in 1609. In 1582 he was named judge in Bordeaux, and in 1608 King Henry IV of France commanded him to put an end to the practice of witchcraft in Labourd, in the French part of the Basque Country, where over four months he sentenced to death several dozen persons. He wrote three books on witchcraft, analysing the Sabbath, lycanthropy, and sexual relationships during the Sabbath. In his opinion, Satan had little sexual intercourse ...
Also, my fingertips are tingling.
@LucDanton I'm still pretty sure you're going to die
I don't doubt those books mention the size of the devil's penis.
@R.MartinhoFernandes ... ouch. Now, that is hist[oe]ry
Meanwhile in the other room
in JavaScript, 2 mins ago, by CodeJack
plz help sir
12:54
@R.MartinhoFernandes lol
Oh boy, now mutable is rearing its head.
Wait, what for?
I was being as lazy as I could be, but I'm going to be a bit more eager to avoid that.
FWIW, I tend to compute in op++ and op* is a one-liner.
why doesn't this work ?
std::chrono::time_point<std::chrono::system_clock> start, end;
end = std::chrono::system_clock::now();
int epoch = std::chrono::duration_cast<std::chrono::seconds>
(end-start.time_since_epoch()).count();
@R.MartinhoFernandes Do you use boost::iterator_facade?
12:56
Yes.
@user1233963 Define "work".
compile
How do you re-map to dereference() and increment()? If you at all need that, I think I'm getting lost.
TIL! Another observation: after finally leveraging the true power of Ex commands for a year, I discover that lesser-known insert-mode bindings might be my next ---blind spot--- underestimated strength of Vim to tackle! — sehe 5 secs ago
@user1233963 Error?
error: 3 3 167 821 not prime
12:58
no matching function to call .. (huge)
end-start.time_since_epoch() is a time point.
You want simply end-start, which is a duration.
Why is the result called epoch though?
(i.e. end-start.time_since_epoch() is timepoint - duration = timepoint, and end-start is timepoint - timepoint = duration)
FML. I just spent 2 hours writing negative test for a feature that is legal -.-
12:59
@LucDanton sloppy variable naming

« first day (850 days earlier)      last day (4323 days later) »