« first day (503 days earlier)      last day (4431 days later) » 

1:05 AM
 
1:24 AM
@LucDanton You mean like wstring and stuff? Or basic_string<char, my_exquisite_traits> too?
 
 
2 hours later…
3:48 AM
k guys, off to bed :)
 
4:26 AM
@Xeo Have you seen Bakuman 2? It's really good!
 
5:12 AM
0
Q: template classes c++

Chris CondyI have a class called AbstractRManagers which i would like to inheritent from a singleton template class Singleton but the abstractRmanager needing to be a template class I have come across some strange error codes that provide no use, Ive tried looking it up but to no luck. template <class ...

I couldn't finish reading the first sentence.
 
Here's a good read:
8
Q: Regular expression preg_quote symbols are not detected

Prof83I have a dictionary of swear words in the database, and the following works great preg_match_all("/\b".$f."(?:ing|er|es|s)?\b/si",$t,$m,PREG_SET_ORDER); $t is the input text and simply, $f = preg_quote("punk"); "punk" is from the database dictionary, so at this point in the loop the expression...

2
 
5:33 AM
Awesome! The new rep. accuracy calculation thing increased my rep. 10 points!
 
I lost 77. But at least now I can go back and see what was deleted. Brings some closure to two deletions that I've been wondering for a long time.
Though at the same time, it also exposes all the -1's and -2's that I've deleted...
 
Hehe.
Mine didn't change a thing. I (used to) recalc about once a week.
 
user406009
5:51 AM
Just wondering is it considered fine to edit for grammar, capitalization, etc? Sometimes people post questions that almost cause a headache when I read them.
 
Yes.
(Unless it's a contentious issue, like British vs American spelling)
 
6:05 AM
I'm profiling my program using valgrind. I see a lot of calls to new, malloc, and _int_malloc, delete, free, and _int_free, totalling most of the runtime of the function, I think. I'm creating a lot of temporary objects (subvectors of a vector) in that function and passing it down to a subfunction. My question is, if I just pass the entire vector down to the subfunction as a reference, that should get rid of the copying costs, right?
 
Yes.
You may want to pass pairs of iterators, instead.
 
@RMartinhoFernandes Ok, thanks.
I thought that new was a replacement for malloc, but it seems to be a wrapper. Also, what is _int_malloc?
 
Probably an optimization.
 
@RMartinhoFernandes _int_malloc?
 
Or maybe "internal" malloc.
 
6:09 AM
@RMartinhoFernandes Ok, thanks.
 
@FaheemMitha new and malloc are not interchangeable, so none is a replacement of the other. new allocates memory, and invokes a constructor on it. It makes sense to resort to malloc for the first part.
 
@RMartinhoFernandes I'm not calling either.
 
std::vector does.
 
So some other routine must be doing this.
@RMartinhoFernandes : Sure. But wouldn't it be calling new rather than malloc?
 
No. Consider std::vector<foo> v; v.push_back(foo());. This will likely allocate space for more than one foo, but it only constructs one.
 
6:15 AM
@RMartinhoFernandes : So malloc is called for the allocation, and new for the construction? Or something like that?
 
3
Q: Handling 'units' in an RTS game - c++

user1244342I'm currently in the process of making a simple RTS style game in c++. What i'm wondering is how to handle the creation of new units in the game (ie. making marines from the barrack). How would i store these units? I was thinking of having a class 'unit' which would then be inherited by specifi...

I don't get it. People heartily recommend std::vector, which is all dandy. But they recommend a std::vector of pointers and then tell you that you have to be careful and manually delete the elements. What's the point?
 
I only need 95 more rep. to reach 2K.
 
@FaheemMitha Yes, that's a possibility. It uses placement new, which goes like this: new(ptr) T() and constructs an object on previous allocated memory.
 
@IntermediateHacker Congrats.
 
@IntermediateHacker Oh, man, you're begging for a lot of upvotes.
 
6:17 AM
@RMartinhoFernandes Right, I see.
@RMartinhoFernandes : I thought one uses smart pointers in that sort of situation.
Though the answer doesn't suggest it, surprisingly.
 
@FaheemMitha Exactly. But it baffles me that people consider std::vector to manage the memory for the array, but then just get sloppy and don't care about handling the dynamically allocated objects.
std::vector<T*> is a half-baked job.
 
@RMartinhoFernandes Yeah, well. Maybe he wasn't paying much attention. I think that C++ now actually has a reasonable smart pointer in the c++ 11 std, shared_ptr or something?
 
Yes, unique_ptr and shared_ptr.
 
before it was auto_ptr which apparently wasn't that good; at least people suggested you not use it.
I see you suggested unique_ptr.
You could add a link for that.
Four answers, and you're the only one who suggests a smart pointer. Tch.
I also see memmove in the call graph. Anyone know what that does?
 
 
2 hours later…
7:59 AM
if it2 is a non-const iterator for vector<int>,what is wrong with it2=container.begin()+ival where container is a vector<int>, and ival is an int?
I get a compile time error
 
@RMartinhoFernandes U"Hello, World!"_s
@FaheemMitha What is it?
 
sbi
@sehe Indeed, that's a really good one, too!
@FaheemMitha How should we know without seeing any code or even the error? I'd wager a guess that the vector<int> is const (are you, per chance, inside a const member function?), but that's a shot in the dark.
@Xeo Someone else had pointed that out already yesterday, but I think you just found the correct words for describing that nonsense.
The Merkin idea of freedom ends exactly at the point where it threatens Merkin values. And, of course, when other nations do the same, they are so wrong.
 
8:25 AM
Hi everyone. Off to work :)
@sbi G'morning
 
sbi
@Mysticial I propose to make a thorough reading of tchrist's answer a prerequisite to becoming a moderator.
@sehe Morning. Stifles yawn.
No matter how long I have been doing it, I might never get used to having to get up at 5:45am. Feels like my brain getting raped every time.
 
@sbi I'm already back from the garage - the car has to have a checkup too... Quick to work, probably got to see how I can pick it back up as well.
@sbi Poor you. That's about the time I went to bed, this time. I can tell you,my response to the kids is somewhat less enthusiastic in the morning when that happens :) Soon forgotten though, a good coffee fixes a lot
 
@sbi : Actually, it is a const member function, yes.
I forgot about that.
 
sbi
@sehe You got to bed shortly before 6am, and at 9am you have already been bringing your car to the garage? When do you sleep?
 
Is it ok to declare data members of an object const if they are not going to be changed after initialization?
 
sbi
8:30 AM
@FaheemMitha I understand that it is really hard to provide the right set of details when you don't know where to look for the problem, but that was very little to go on for us. You should at least always provide the error message.
 
@sbi : Ok.
I think I see what the problem was here.
I could try to cook up a minimal example.
 
sbi
@FaheemMitha If you do that, it's nearly impossible to write a meaningful assignment operator. If the class doesn't have to be assignable, then it might make sense. (Note that I haven't seen a case where this would be the right thing to do in >15 years of doing C++.)
 
@sbi Ah, Ok.
In this case, I only create the object and then use it in one place. So no assigment, I don't think.
I'll experiment.
 
@FaheemMitha Since the private interface (and private world) of a class is (or perhaps should be) small, it's actually okay to rely on the convention that since the member isn't designed to be modified, then it won't.
 
8:34 AM
@sbi In between :) Not all nights are this short. I've been tuning / refactoring my work project all night. I'm not sure whether I'll keep all the work. I feel the end result, albeit slightly purer and less code, was starting to smell of Java in a funny way. Sometimes I think I love the 'literate' style of a script method that just . uses the occasional top-level switch(nodeType) for clarity of the mechanisms
 
sbi
damn support call
 
@LucDanton Actually, the class is a struct here.
 
Same difference.
 
Or maybe you aren't using private literally?
 
I am.
If the member is publicly accessible then the decision to make it const or not is a bit more involved.
 
8:36 AM
@LucDanton : So you don't think declaring data members const is necessary?
 
@sbi lol, I love that idea! Next election... maybe we should spam it on to all candidates profile comments.
 
I would be much more reluctant to expose a non-const member that is supposed to be immutable.
 
@sbi Darn. That is a real disappointment: Opera turns out to be the only browser that doesn't select a suitable font on my system:
 
I.e. it's okay to rely on such a convention in the private world of the class because you can't write private code and not be aware of the convention but it isn't so for client code.
 
There a dent in my high esteem of Opera. Chrome and FF got it right.
 
8:38 AM
@LucDanton : Ok. So it is not necessarily so unreasonable then?
 
@FaheemMitha Yes. Because having an assignment operator is usually more important.
 
sbi
@sehe Ah, Ok, I was wondering. There are people who feel well with an average of sleep of about 3hrs/day, after all. Me, I'd like to have 8hrs, get along with 7, and survive for a while with 6.
 
@sbi I think I'm roughly in the same category. I'm pushing the limits here. Thank God it's Friday
 
@LucDanton I meant - it is not necessarily so unreasonable to declare data members const. I think you thought I mean the reverse.
 
13 mins ago, by Luc Danton
I would be much more reluctant to expose a non-const member that is supposed to be immutable.
@FaheemMitha Provided that member is private.
 
8:51 AM
So, in these cases do people not declare them const and use accessor functions instead? I don't really like accessor functions; they're annoying.
 
Not everything private has to be exposed. Otherwise what would be the point of making it private to begin with?
And 'expose' doesn't mean a getter either.
Let's recap: private, immutable => non-const okay
public, immutable => questionable
Does that make sense?
 
@LucDanton True.
@LucDanton You mean you think public + immutable is a bad idea?
Or questionable meaning it should maybe be const?
 
Second.
It's not an easy answer though. Really will be on a by-case basis.
There are cases when assignment doesn't make sense so marking immutable members const is a no-brainer.
The worst option is making the member const and then implementing operator=.
 
@sehe Fixed it, by installing a random set of fonts (I think the Ethiopian scripts were missing. One of these days I'll check what fonts Chrome and FF were using all the way)
 
@LucDanton : Ok. In my situation, I have an object which can be const after creation, has public members, collection of related data objects, basically, and doesn't need to be assigned to. So I made the data members const. It runs and compiles.
 
8:57 AM
I can now proudly read all the twisted forms of Br*ainF𝖀ȼѤ that you can come up with :)
 
sbi
@Mysticial Yeah. You might want to look at this answer of mine on the subject. I just now added a link to tchrist's answer to it.
 
@FaheemMitha It makes sense to take that road, yes. Notice that in your case nothing can blow up.
 
You know it's serious when you have to resort to Ethiopian fonts to say the word "𝒻𝓊𝒸𝓀".
 
sbi
@sehe Nothing is ever perfect, not even opera.
 
I think no assignment operator can make sense if you are creating an object to carry constant data information around.
 
8:58 AM
This is why I consider the option where you implement operator= the worst: you can get it wrong and have it blow up.
 
Depends on who composed it and who performs it - mostly
 
@LucDanton : I hope nothing does.
 
sbi
@sehe Yeah. I, too, have been doing 36hrs coding sprees. Right now, though, I don't feel up to doing those anymore. Maybe I had have a few too many sleepless nights with kids. Or I'm just too old for this shit.
 
@FaheemMitha An alternative is to let the client code create const instances of your type. Then the members inherit const.
 
@LucDanton If data members are declared const, then you are forced to define assignment, right?
@LucDanton : Well, the objects are already created as const.
 
9:00 AM
@FaheemMitha No, you can leave it deleted. The problem is when you want assignment and an immutable, public member.
 
@sbi Oh. I consider myself 'old and wise'. I don't do /silly stuff/ like that anymore. Hah. Only about 18 hours and immediate weekend compensation
 
@FaheemMitha Right, so sometimes it's okay to leave the members non-const.
 
No, hang on.
 
I'm sure one day, I'll be wiser still :)
 
They are passed as const args, which is not the same thing. Hmm.
 
sbi
9:01 AM
@FaheemMitha Accessor functions are a hint that your design is questionable (PDF link).
 
@LucDanton : If you don't define the assignment operator, and the data members are not const, then the default assignment operator will not exist, right? And if you try to use it, I assume the compiler will complain.
@sbi : yes, I hate accessor functions.
 
sbi
@ScottW My worst was a week doing 100hrs of work – and I even had a day off that week. I left the company soon after, and took half a year off before getting a new job.
 
@FaheemMitha More often than not you do get an assignment operator. This is usually (and I really meant for most of the time) desirable.
 
@sbi : Sounds rough. Are programming jobs usually so labor intensive.
@LucDanton : Right, but I've never had to write one. It has existed without my constructing it.
 
@RMartinhoFernandes Oh, due to overloading rules 30_s; "Hello, World"_s; are both fine.
SI it is!
Oh wait, can't have µs in source :|
@FaheemMitha Yeah, that's the desirable part :)
Uh, is cond.wait_for(30_mus); really clear on its intent?
 
sbi
9:07 AM
@FaheemMitha That depends on whether you work for a company that knows software business or one that doesn't. Guess which category that company was in... It was my first job, so I might be excused for putting up with them even for a year. I have since tried very hart to avoid such employers. A few strategic questions during job interviews usually will make them reveal their attitude towards this. (And a few firm statements about yours will give you a chance in the company if it doesn't.)
 
@LucDanton : Right, I see what you mean.
 
sbi
@ScottW That's probably just as bad.
 
If I have invoke (which is used like invoke(f, a0, a1, a2)) what's a good name for a utility that returns a functor that calls invoke with bound arguments? delayed_invoke?
invoke_bind?
 
@sbi : Anything much over 40 hrs a week regularly, and code quality starts dropping, imo. Unless you really, really love what you are doing.
In which case it is not just a job.
 
sbi
@LucDanton bind?
 
9:16 AM
@sbi But it doesn't support things like nested bind expressions and placeholders, which are part of make std::bind what it is.
 
sbi
@FaheemMitha No, it becomes your life. I'd consider that a poor life, though.
 
@ScottW Can't you do your own stuff in those situations? Like your own projects?
 
sbi
@LucDanton Ah. create_invoker? Urgh.
 
@sbi : True.
 
@sbi Oh right, make_invoke. Good catch hah.
So make_invoke(foo, a0, a1, a2)() is equivalent (to an extent) to invoke(foo, a0, a1, a2). Doesn't look that bad, does it?
 
9:20 AM
@ScottW Ok.
 
@LucDanton unfortunately i have no idea
 
How come?
 
oh hey, I dropped below 90k rep again
 
9:35 AM
Okay, I seriously am starting to think that HP is retarded.
Ever since I bought their Deskjet Printer 2 months ago they've been bugging me for a survey, they even gave me some downloadable free software for completing the survey.
And the ONLY question they asked in the so important survey was , "How many printers do you have at home?" Seriously, Was this even necessary?
What benefit could they possibly get by knowing how many printers I own?
 
I can't seem to install the VS11 Beta Ultimate in my VBox running the Windows 8 Beta.
 
10:03 AM
morning, blokes
Bouncing just another meta request off you
0
Q: Replace hyphen in front of scores/reputation by minus

Konrad Rudolph (Actually a dupe of another question but that was incorrectly closed so I’m posting here until the other question gets reopened, and this one merged.) This has bugged me for ages. The website uses hyphens in negative numbers throughout. It should use the minus sign instead. Of course it’s n...

 
sbi
286
Q: Upcoming Reputation History Changes

Nick CraverUpdate: This has been rolled out to all sites in the network. Behind the scenes we've been hard at work making some changes to how we track reputation. Here are some of the issues we're aiming to address with these changes: Reputation Skew (your actual reputation doesn't match what's shown)...

 
@sbi yeah, I saw
I lost a few tens of points because of "vote fraud" whatever that means, and probably a thousand or so on questions being deleted where I had an upvoted answser
 
 
@jalf How do you see “vote fraud” in the tracker? Are they really displayed like this?
or are they merely marked as undone?
@jalf Awesome, it does display it :)
 
user1182183
Hey is anyone here familiar with mutexes in C or C++ ? :P Kinda got a little problem where a mutex can't be aquired somehow
 
10:13 AM
@jalf It's not clear what was the vote fraud in your case. If you take a look at Jon Skeet's rep-tab for today, it's very clear. Somebody serially downvoted him.
 
sbi
@RafalGrasman Are there mutexes in C++11? If not, or if you are not using those, this might have little to do with C and/or C++, but more with the API you're using. (I'm not saying nobody can help you with that. It's just that we don't know which ones you use, so nobody knows whether they can help.)
 
@Mysticial SO actually has quite good detection algorithms in place
 
user1182183
no, no C++11, for the windows part I use just the process.h and windows.h and on linux the pthreads, however the problem is in windows yet, not tested the code on linux
 
of course i’ve got no data on their reliability but they “feel” reliable
 
@sbi FTR there are.
 
10:16 AM
@KonradRudolph Kinda. I was also caught up in part of the serial downvoting that hit Jon Skeet today. Apparently it wasn't just him, but a lot of the competing answers today also took downvotes (including mine).
But I only took 1 downvote, that's not enough to trip the fraud script.
 
user1182183
I did create a tupic just nobody seems to want/be able to answer, Don't know if my question is bot-clear but I think it is answerable, stackoverflow.com/questions/9523532/mutex-cant-aquire-lock
 
@Mysticial Interesting … backstory? Normally serial downvoting is just revenge for a critical comment
 
lol, by the looks of it, 8 hours ago Jon Skeet got serially downvoted on at least 5 answers. Every single competing answer with a positive vote count also took a downvote... lol
 
@Mysticial If this kind of behaviour happens more often, perhaps proposing an algorithm change is in order. How about, if somebody has been detected as a serial downvoter in some window of time, undo all his other (non-serial) downvotes in that same window as well
 
I don't get downvoted very often... And it's especially rare when my answer is correct.
 
user1182183
10:19 AM
my question got -3 but now it has 0, luckily ; o
 
Personally, I don't mind the downvote today, since it seems likely that I'll repcap.
 
when my answer is correct i seldomly get downvoted. when my answer is correct and humble then i'm frequently getting downvoted :(
 
user1182183
Weird, ; o
 
user1182183
maybe try asking the reason in a comment? xD
 
Mmh, std::forward<T&>(ref) is ambiguous where ref has type std::reference_wrapper<T>. That's not convenient.
 
10:23 AM
hmm
@LucDanton why is it ambiguous
 
I haven't studied the question, that's what GCC tells me.
 
I've taken about ~35 downvotes total in my time on SO out of about 800 answers. Only 2 or 3 of my answers have multiple downvotes.
 
user1182183
I always try to answer from my own experience and some references online. Just sometimes a simple google search can answer something here :P
 
@Mysticial yeah, I'm assuming vote fraud means that someone upvoted me in a "bad" way, and that got zeroed out
 
@JohannesSchaublitb Is it because there are two overloads for std::forward, one taking RemoveReference<T>& and the other taking RemoveReference<T>&&? At least I can reproduce the same error message if I have such an overloaded set.
Not sure why the RemoveReference<T>&& is being considered though...
 
10:26 AM
*granted, I tend to delete the ones that do get multiple downvotes...
 
GCC accepts int i; auto ref = std::ref(i); int&& j = ref;
So then that explains the ambiguity.
 
@LucDanton the c++11 rules for converting of a class object using conversion functions to references are incomprehensible.
 
guys this really is a dumb question but I cannot find it :(
In VS I want to use environment variables in paths (to includes, libraries etc), where can I set the set these environment variables?
 
defect report resolutions fixed them but I forgot how they fixed it
 
The qtprojects I have have set $(QTDIR), but I cannot find it anywhere in the VS gui.
 
10:28 AM
@JohannesSchaublitb Well even for C++03 I've stayed away from the overload resolution + conversions rules on purpose. I'm still not getting anywhere near this kind of things.
 
FWIW I'm having the problem with an actual class type, too. I'm just replicating with int.
Welp guess I'll have to write a maybe_unref helper, how inconvenient. Nevermind the conformance.
 
@LucDanton that is an awful naming convention. We have a dozen or so maybe_x() functions in our code base, and I hate it
 
@jalf It's in a detail namespace. And yeah I really wanted to avoid writing that.
 
Why?
 
10:32 AM
maybeLogin(), for example
 
maybe_x() makes sense.
 
Was relying on the usual implicit conversions but since it can't happen with std::forward, gah.
 
every time I have to modify it, I'm tempted to just have it return false and write a log message "maybe logged in"
 
lol
 
Oh god, now I'm hitting an ambiguity in std::forward<std::reference_wrapper<int>&>(maybe_unref(ref)), wtf.
 
10:33 AM
@wilx when you want x to happen, you call a function to make it happen, and then the function should either make it happen, or fail. It shouldn't maybe make it happen
 
@jalf It's not unref or fail though, it's unref or pass-through.
 
any ideas?
 
@LucDanton yeah but my point is that the "maybe" name is really bad because the semantics of it isn't clear
it sounds more like "unref if you feel like it", rather than "unref if it needs to be unreffed"
 
I don't see the difference between the two :p
 
@LucDanton The former doesn't say anything about when it'll be unref'ed, or if you can rely on it happening
it could depend on the outcome of a rand() call
 
10:36 AM
Neither does naming it unref tbh. Still have to look at the details to know what it affects.
 
I'm not saying you should name it unref, just that maybe_unref is evil
 
@jalf How does that work type-wise :)
 
I'd try to name it after the invariant it guarantees: as I understand it, it unref's types which can be unreffed, and passes others through. In other words, you don't know whether it unrefs, but you know that the output will be unref'ed
either because it was already unref'ed, or because the function did it
@LucDanton do I hear a challenge to implement a compile-time rand()? ;)
 
@jalf: I use maybe_x() when x either can be already done or needs to be done.
 
@jalf That's it yes. And in that respect I feel like unref and maybe_unref both conveys the meaning. I don't get the 'it might depend on arbitrary things' vibe.
 
10:39 AM
@LucDanton well, having had to work with maybe_x functions for a while now, I have to say that their meaning is far from clear to the reader
 
Then again maybe is a name that I've seen a lot e.g. with optional types.
 
@LucDanton well, that's just it imo. With optional types, maybe conveys something different, namely the absence of an invariant: You don't know whether an object exists or not
with maybe_unref it implies the opposite: that you're guaranteed something about the resulting object
whether or not the function actually unref'ed is an implementation detail that the caller shouldn't need to worry about
what the caller cares about is that the result will be unref'ed
 
Right, usually with maybe it's about the returned type/value, whether here I care more about the argument type/value.
That's a very good point.
 
I renamed our maybeLogin to ensureLoggedIn, but I realize that gets a bit verbose for something like unref
 
maybe_do_foo: a -> Maybe b vs maybe_unref: a -> a | Ref a -> a obviously they're not similar.
 
Wil
10:42 AM
Does anyone know of a service/site/software where I can quickly test regex rules? e.g. I have a pattern and want to type a string to see if it hits it or not?
 
(Let's pretend | is here for overloading.)
 
but naming-wise, I like that because it clearly tells the caller that you're guaranteed that after the call, you're logged in, whether or not you were logged in before
isn't there already a std::remove_reference which does basically the same though?
 
user1182183
@Wil do you mean regextester.com ?
 
@Wil echo "test" | sed "/pattern/p"? Not overly familiar with sed though.
 
Wil
@RafalGrasman Thanks, I googled it and found it, but, couldn't understand it... so wanted a personal recommendation! just actually read the site this time, and it works fine!
 
10:46 AM
@jalf 1) that's a metafunction 2) I'm unreffing std::reference_wrapper
 
@LucDanton ah right
anyway, my point was more about the name. It guarantees that the result will have reference qualifiers removed, but the implementation sometimes just passes through
 
7 mins ago, by Luc Danton
maybe_do_foo: a -> Maybe b vs maybe_unref: a -> a | Ref a -> a obviously they're not similar.
You've convinced me yes.
 
@LucDanton Cool. Now let me know if you come up with a good concise name to describe this sort of function. ;)
I'm still not too fond of my ensureLoggedIn. ;)
 
Going with unref tbh. It's still in a detail namespace so sooner or later if you want to review the associated class you have to review those helpers.
 
@LucDanton I think that's an ok name too. Kind of like remove_reference, it guarantees that the result will be unreffed
 
10:50 AM
I don't mind ensure when it comes to side-effects though. Well if it does in fact ensure something.
 
even if it didn't need to do any actual unreffing to achieve that
 
sbi
There's a subtle but important difference between "Can not work everytime" and "Does not work anytime." (Me to a cow-worker of mine in reply to him excusing MS never getting progress bars right.)
 
@jalf Right. Before your killer argument I felt like maybe_unref and unref were on an equal footing (neither does tell you what is being unreffed or not) and didn't catch that the maybe convention affects output, not input.
And now it compiles and passes tests. Although tbh this means ending up with a 4-line monster return statement.
 
morningcakes
 
Also today I used const_cast! In generic code!
 
10:54 AM
@LucDanton not just to cast away inconvenient const-ness and enter UB, I assume? ;)
 
I can't decide if this is a good or bad start of the day.
@jalf Presumably no, but of course I get the nagging feeling that something might go horribly wrong.
On the other hand it's for casting away volatile (temporarily of course). And I never use volatile. Oh well.
Hurray, I can now do tuples::zip_with(operators::make_invoke {}, std::forward_as_tuple(f0, f1, f2), std::forward_as_tuple(a0, a1, a2, a3, a4))(). Probably.
 
I can do that too.
Probably
 
Har har. Writing a test case as we speak.
 
@LucDanton well, i don't know. on the one hand, my blood test showed that i have diabetes in addition to all the rest. on the second hand, my taxi was not the one involved in a nasty traffic accident outside my doctor's office. and the sun is shining! i don't quite know what's on the third hand. something.
A polite way to say "RTFM"?
 
@CheersandhthAlf You do qualify for a bad day. You'd qualify even with a third hand!
@CheersandhthAlf I tend to link directly to the documentation, assuming there is such a link.
@sehe Test is working as expected (although my snippet wasn't accurate to begin with, can't use () on a tuple), what say you now :p
 
11:10 AM
@LucDanton good work :)
 
I can express what I wanted in the first place with tuples::apply(operators::call {}, tuples::zip_with( /* bla bla blah */)), fun.
 
11:25 AM
Nobody seems interested in my palindromic numbers question :(
I thought this would actually generate some interest
ah well, no excuse from work then
 
11:47 AM
I need a trick to make a variadic pack dependent. I.e. I have template<typename... T> struct foo { template<typename D = Compute<T...>> void bar(); };
And I don't want errors when instantiating foo<U...> if Compute<U...> is ill-formed.
Oh well, guess I'll have to abuse tuples once again.
 
sbi
So often they are abused, those poor tuples.
 
12:03 PM
@luc what about typename identity<T>::type...
 
Thank you for preserving my sanity.
 
wait. i mean typename second<D, T>::type...
 
Right, I'll call it dependent or something.
 
ah no the identity thing should be enouh. silly me
 
I'mma try.
 
12:06 PM
but wait.. i think you will need the D thing :-)
yeah pretty sure
 
It's fine. I'm already accustomed to typename U = T when it's not a pack. typename D = void, typename Foo = Compute<Dependent<U, T>...> is fine by me.
@JohannesSchaublitb GCC does reject using Identity alone.
 
yeah you need the second thing with D
 
Works as expected.
typename Result = ResultOf<SignatureOf<Restore<Dependent<D, T>>...>>
It does add boilerplate to an extent.
 
why dont you access the T right away? l
 
Um there's more than one T. What kind of access do you mean anyway?
 
12:13 PM
or is Depend an alias template that does it behind the scenes?
 
Depend is the alias to depend.
So I'm making each T depend on D!
 
like Depend<d, t>::type...
 
Oh right, bad name.
 
ohh i see now
 
I've coopted PascalCase to denote aliases to metafunctions/traits.
 
12:16 PM
> I've been Microsoft-free for years.
lol
 
So before the crude Depend trick the computation was ResultOf<SignatureOf<Restore<T>...>>, which isn't that bad is it?
 
Restore each T, transform the pack in a signature, what's the result type of that?
Although I just moved Depend to a meta namespace.
 
hmm
time for me to go buy food
 
12:48 PM
@JohannesSchaublitb he he you got eyes!
 

« first day (503 days earlier)      last day (4431 days later) »