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

06:00
wtf, I also support multiple arguments?
Anyway, I got more pressing matters. Like sleeping.
Good night everypony.
Wait, wait.
C++/CLI ?
How do you interact with DirectX like that?
@EtiennedeMartel Butt Stallion says "good night".
@ThePhD With the left side of the /.
06:03
But he said fuck that COM bullshit...
... Isn't he still using the COM? D:
I'm so confused. ;~;
@ThePhD (Fun fact: COM is also usable as a C++ API)
yes, DirectX is COM - without a lot of the ugly COM stuff
... So he's still using COM, right?
The C++ side of COM.
Oh.
06:04
Stop it with the questions, I don't want to go all robot style and still be not sleeping in a hour.
2
I just had to know. D:
Good night!
@EtiennedeMartel morning
main.cpp:15:8: error: call of overloaded 'f(int&)' is ambiguous
     f(i);
        ^
main.cpp:15:8: note: candidates are:
main.cpp:6:6: note: void f(std::reference_wrapper<long int>)
 void f(std::reference_wrapper<long>);
      ^
main.cpp:7:6: note: void f(std::reference_wrapper<int>)
 void f(std::reference_wrapper<int>);
      ^
Thoughts? I'm taking a look at the Standard.
MinGW uses CVS? WTF? -- nevermind, was outdated page
Don't tell me it's the deleted T&& wreaking havoc...
Doesn't appear to be. Time to take a dive into libstdc++.
Implementation is by the book.
Okay, it is the deleted T&& constructors that are doing that. But it may be a bug.
Oh man. If you have an overload set of int&, long& then an int lvalue results in int& being selected. If you have int&&, long&& then long&& is selected. Overload set of all four is ambiguous.
Hello there , is anyone here familiar with DirectX 9?
Scratch that, the set of all four is not ambiguous. But when converting constructors are taken into account there's something that changes.
@LucDanton One day, I'll understand wtf you just said. For now this is Chinese to me (no offense @Mysticial)
"Woher" is "whence" and "wohin" is "whither".
06:17
Anyway, off to bed.
Oh, so 'whither' is the corresponding question thingy to 'hither' then?
Hm.
Guys
If I have the type information of an object
Is it possible to create a new instance using that type descriptor?
@LucDanton Yes.
Actually, just thinking about it...
No, I couldn't.
=[ Sadface is sad.
That's full blown runtime reflection. It needs metadata carried around.
06:21
Yeah...
No Activator.CreateInstance for C++ any time soon.
My best hope is to define a virtual overridable member on the class that can create an instance of the desired derived class.
That was base types without full knowledge of the derived type can make derived-type babies.
You have invented the abstract factory pattern!
YAY!
Do I get points for figuring it out? :D
Ah, I see! Forgetting about the class template makes it clearer. If I have void f(foo); void f(goo); where those types have resp. constructor overload sets of int&, int&& and long&, long&& then yes, there is an ambiguity.
In other news, deleting (non-special?) constructors still sucks. Or maybe just for class templates? Still not decided.
@R.MartinhoFernandes So, do you have an opinion on using overload resolution rules for variant construction now? :p
06:25
Kill it with fire.
Accept only exact types.
:c
But
But sometimes looseygooseyness is nice~
Maybe tags for emplacing.
Current rules use two passes: choose the first 'related' (i.e. exact modulo cv/ref) type, or if that fails the first convertible/constructible type. Left to right.
I'm fairly sure that explicit-ness is straightforward, too.
Um. Quick question.
It's not like you make Eithers without Right.
06:28
@R.MartinhoFernandes I'm missing that and have been thinking about it for a while, yes. So you can do variant<int, long> v { Blarglurg<1>, 0 }; I suppose. Perhaps with some emplacing, too.
@ThePhD Time's up. Next!
Aww, but.
But this is a good question I promise. :c
@LucDanton If you don't allow variant<int, int> (do you?) I would consider blarglurg<int> too.
For some reason, I've always thought I can only access derived members using a pointer-ified, type. Is it possible to make a non-heap-allocated base class and have it still call the derived functions?
.... Then again, syntactically, in my head, that just doesn't work out...
Base b{}; // <--- How would this ever become.. Derived?
06:30
I remember when we talked about that. Those are coproducts right?
Yeah.
@ThePhD That's why you can have nice things like slicing. (It was useful once!)
I suspect it might work but without the constructor obviously you can't end up with which() == 1.
Hm. Is it possible to return a Derived type through a function, though?
Ah, I have an assertion that forbids it.
@LucDanton Well, when I said allow, I actually meant support.
06:31
Base b = GetMeADerived(); // Is: Base GetMeADervied() { return Derived(); }
No, that slices.
@R.MartinhoFernandes That's why I said 'no'! Didn't I?
Oh, so I'm still at the slicing problem...
If the destructor is virtual, will it still call the destructor for the whole thing?
Or will it be permanently and forever sliced?
Slicing makes a new object (the old one dies normally with its scope).
... Ah, so I'd only ever have a base.
Sadface. =[
Guess I have to do some pointer trickery.
Heapity heapity heap.
06:33
Okay, if I remove the assertion then it compiles. The reason I have the assertion however is for apply: I 'fold' repeats so it's not a real whatever coproduct operation it's supposed to be. So it's not enough to add the constructor, I need to take a stance on that (and implement it).
I say don't bother.
Yeah nobody needs that right?
And if you do, it's isomorphic to tuple<bool, int>.
I think clients that want the functionality would rather store the result of which() somewhere though.
int + int = 2 * int = bool * int :) I love this notation
@LucDanton That's the bool.
06:37
Yeah but that's just not as convenient when taking into account C++ overload resolution.
I.e. you might 'lose' more than one repeated type.
variant<std::vector<int>, std::deque<int>, int, short> v = /* ... */; apply(make_overload(size(arg1), fallback(arg1 + 1)), v);
(Except that I don't have an expressions::size I think I already have the functionality for that mouthful!)
Noo, don't leave uss. D:
07:13
@R.MartinhoFernandes That reminds me I identify the result of apply(f, v...) to T if it otherwise would have been variant<T>. Much like I would like to see a language with an interesting record system, I would like to see good support for products/coproducts out of curiosity.
That's a short commute.
It can be shorter if I don't arrive at the station when the trains have just left.
Nicely situated then?
Time to think of a good name for that tag thingy. variant<int, long> v { At<0>(), 0 }; sort of deal. Plus another name for the type version.
I ride the S-Bahn for two stations and then the U-Bahn for two more stations. But changing can cost me lots some days.
Meanwhile on Stack Overflow...
Now users are asking why they don't get unspecified errors.
-4
Q: declaring a variable in a loop

singingsinghCan anyone explain why I am not getting an error. #include <iostream> using namespace std; int main () { for ( int i=0; i<10; i++ ) { int k = 2; cout << k << " "; } return 0; } Its a very simple question. I think its taken care by the comp...

07:26
Ah, I used to live in that kind of situation, but with tons of stations for the RER part. Not that I needed to go to Paris for long.
I'm thinking I won't use a tag but use std::integral_constant + an emplace tuple. Types are not supposed to be constructible from that, so there shouldn't be ambiguities.
@LucDanton I'm so curious what kind of work makes you ponder all these questions. Why aren't you (a) on the committee (b) writing a book :) ?
I dunno, I feel an itch. I have to scratch it now and then. I'm not doing either because I have very few rules of thumb that I think are genuine, good advice that anyone should benefit from (that are not widespread/written down already).
user1357851
real person or not
user1357851
looks a bit plastic
07:32
Some of those that I have I suspect C++ is already shying away from (e.g. std::common_type might be a lost cause, I'm not sure.)
@R.MartinhoFernandes: It's funny. Most of us were eager to start using C++11 before it was even standard. But C99 is still ignored by a large sector. — Benjamin Lindley 1 min ago
I wonder what this says about the C and C++ communities.
user1357851
@R.MartinhoFernandes barbie thrown into the bin, you are so cruel >_<
It's NSFW-ish.
I was also trying to the bin it as well. But the robot is too fast.
@R.MartinhoFernandes 'Give me my vendor or death'? I've never the really innovative part of C in use anywhere.
07:34
The mistery word is "seen"?
Sure, why not.
@Telkitty Be glad it's just the doll. Of course that's not welcome in the lounge. You could have linked and marked NSFW
hello guys .. I want to learn c++ I have already learned basic just like oops and C++ .. bore some time and now working on java .. could you tell me what is good ide and compiler to run c++ program I have tried turboc 3 which I think quite old and outdated ..
user1357851
visual C++
user1357851
if you are on linux try g++
07:38
@LucDanton "the really innovative part"? What's that - VLA's?
@sehe _Generic comes to mind.
I am on windows os (Window's 8)
@LucDanton You know. I never even heard of it... :(
@sehe It's C11.
I think someone cynical would say that the only people likely to use that are those writing container lib proposals.
07:39
Call-site overloading.
@LucDanton I think you could say that someone cynical would also be someone realistic
Someone cynical would say that!
Thank you!
user1357851
@sehe I am not sure she is a doll
07:43
@Telkitty Blarg? Meh.
user1357851
she in more revealing clothes, but it is published on a online newspaper (dailymail) so I would say it is workplace safe @_@
could you let me know any good source to learn c++ ?

or book
2112
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are released every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a good C++ book...

@R.MartinhoFernandes thankyou ...
not gonna troll you more .... bye
I must have missed the trolling.
It's weird. I think I like German :|
07:46
Oh yeah, I do have some actual advice that's not widespread enough, like avoiding T t { std::forward<U>(u)... }; construction in a generic context. I'm making a note of it.
Good ole std::vector<int>?
sorry last question I read Dennis ritchie c book and that was like a mess .... any good source for c ?
@Telkitty Don't feel obliged to employ logic there, buddy, not on my account.
@sehe What is wrong with you?
07:49
:) Was it that much over the top?
I'm allergic to people defending themselves unnecessarily. Especially if that makes them say insane things like "but it is published on a online newspaper (dailymail) so I would say it is workplace safe"
@sehe Depends if you do end up giving advert hits for the DT or not I suppose.
> This level, according to GCC developers, should be better than the default -O0 optimization level.
Why don't they just make it the default?
No one ships code with the default optimization level anyway.
Wait, do I have that?
07:51
@LucDanton I had to make up a real-sounding title for a newspaper site. It exists? Good!
I need to finish what I'm doing and check it.
@sehe lol!
@R.MartinhoFernandes probably convention
What convention?
Btw I was just taking a shot at the right-leaning DT. (I think? What do I know about British politics!)
@R.MartinhoFernandes ... that -O0 is default
07:53
Meh, if changing that breaks your code, your code probably needed breaking.
right
Next time I won't write template<typename... T> struct variant { /* ... */ };. The definition is almost 200 line long and putting T in that large a scope is asking for trouble.
So what will you do instead?
Not sure yet. template<typename... Elements> was the first thing that came to mind.
Although that suggests that variant<Elements...> is a container of several elements, which is weird.
07:57
One thing at a time. I'm still writing that 'emplace in slot' functionality (heh... maybe 'slot' is right).
What's the Vim thing to switch case from normal mode? And should I bother remembering that?
Your overexposure to Korean pop music last year will be nothing compared to your overexposure to Korean nuclear radiation this year.
@LucDanton Or g~ (operator)
@LucDanton Yeah, it's nifty. TBH gU and gu are more useful. And g? is just ludicrous
> This week my professor wants me to change out all the indices and use only pointers. source
why??
user1357851
stay away from east Asian full stop - at first was the Japan nuclear leak now is the north Korean nuclear test
Thanks. It's like how one of the most common typo is swapping two letters, and you can xp that around (I did not forget where I learned that!); I do tend to delete some words at the start of a sentence and I need to make the new initial letter a capital.
08:01
@LucDanton Hehe.
When I first learned xp I thought I'd never use that.
Couldn't have been wronger.
@TonyTheLion To drive the point home that the two lead to the same emitted code, but enable different types of algorithmic thinking on the source code side?
@sehe lolwut
@LucDanton Yeah, xp is one of my most used sequences in vim
@sehe Ha. You think.

Iterating arrays by indexing or with pointers

Dec 19 '12 at 14:19, 1 hour 10 minutes total – 189 messages, 15 users, 6 stars

Bookmarked Dec 20 '12 at 12:30 by R. Martinho Fernandes

@R.MartinhoFernandes Well, to be honest, as a didactic exercise that makes sense. Never mind (un)optimizing compilers.
08:05
MSVC, you mean.
Also, in that conversation I learned:
Dec 19 '12 at 14:35, by R. Martinho Fernandes
g++ -S -masm=intel => AT&T. g++ -masm=intel -S => Intel. Fuck you GCC.
@R.MartinhoFernandes Gah I should have made myself more clear. I meant to say: what code gets generated is irrelevant (and often identical). Because you're aiming for elegant, robust code, not generating assembly
@R.MartinhoFernandes Oh. I might have been bitten by that one and never solved it. That's ..... "harsh reality" indeed
Lol. This has got to be a joke: github.com/minitech/jquery-concat (by minitech)
> jQuery-Concat is an elegant way to concatenate strings in jQuery. With over 5 unit tests, string concatenation has never been more easy or reliable*.
@sehe +1, jQuery is awesome.
08:10
Btw, I now have two spare blog posts written, which means I can run a schedule!
At least until March.
And I have four spare themes to write about. So, new post every Monday. Let's see how long I can keep this up for.
@LucDanton lol
You can make bets, I don't mind.
@R.MartinhoFernandes Ya know I don't mind if you don't publish anything :p
@R.MartinhoFernandes What's the idea of keeping a schedule?
@LucDanton Wut
@sehe Discipline.
08:14
@sehe IIRC our friend used to do some (creative?) writing, I'm starting to suspect he is/was one of those writers that discipline themselves.
Man I'm slow.
user142019
Good morning, Lounge<C++>.
I understand those jabs about me writing that thing now! Never figured why you cared since you already know everything about that.
user142019
@LucDanton Oh noes, you're reverse engineering me.
user142019
YEL: all instances of Functor in Haskell are endofunctors.
08:16
@R.MartinhoFernandes mkay. I should try that, once :)
Dec 19 '12 at 14:53, by R. Martinho Fernandes
The moral of the story is: don't use // ... nor /* ... */ for comments. Use asm("# ... ");
^ Did you ever ask that one?
@sehe Keep reading.
@R.MartinhoFernandes Sorry! I'm just glad I don't have to bear the guilt of not writing that for you :p
user1357851
would I get suspended for posting a pic of a cake (only the cake)
@R.MartinhoFernandes Damn. i need to go to work. Sadly
@Telkitty If you really want to, I guess
@R.MartinhoFernandes This got me thinking, but isn't the answer incomplete? I.e. is there a way to insert comments without disturbing GCC, what with that clobber list thing?
user1357851
08:18
@sehe if I don't want to?
@LucDanton The thing is, where shall it put the comments if it throws your code into a blender?
@R.MartinhoFernandes Oh lawl. I upvoted that question. <memory failmode="embarassing"/>
user142019
Dead Bodies Everywhere is a nice song.
@LucDanton Adding comments before and after the loop is the best way.
Oh okay. That's even simpler then.
08:20
Inside the loop you either get no optimizations or you risk getting your comment tossed around when the compiler optimizes the loop, drastically reducing its usefulness.
Oh, that day I learned to try -fverbose-asm before tossing asm comments in.
user142019
> class (Category r, Category t) => Functor f r t | f r -> t, f t -> r where
@R.MartinhoFernandes Still, let me link this again in case you missed it!
user142019
What do | and , mean here? I've seen them before but I never knew their purposes.
Nah, I saw it. But it appears only two other people +1ed.
@Zoidberg functional dependencies IIRC.
Nah, that doesn't matter. But now I can link to that whenever someone abuses std::function!
On the one hand it's not as exhaustive as what I once considered writing but on the other hand I think it's comes up as much much more accessible. I was really concerned with losing the interest of the reader.
tl;dr it's as good as I'm going to write on the topic for a while!
08:24
I'll be making a post with a new bunch of small traits, and will mention Requires in it.
Mmmh, have you been using it? I'm still torn on actually advocating it because I simply don't appear to run into it. It's nice documentation, sure, but I can't tell if it saves me.
Well, I remember Konrad not liking a static_assert because it's not "in the interface".
Then I showed him Requires and he bought it.
afk
@KonradRudolph Hi! I would love some input on you using Requires 'clauses' some day.
user142019
@R.MartinhoFernandes yes, thanks.
08:27
(Any better name than 'clause'? What did the concept proposals use?)
Jan 13 at 20:03, by Konrad Rudolph
@R.MartinhoFernandes I prefer having the interface specified in … well, the interface. That includes template arguments. That does not include static assertions in the implementation. Ultimately it’s not a huge difference but it serves as auto-documentation when only the declaration is available.
Was around here.
Mmmh, should I provide variant<T...> v { Int<3>(), emplace, bar, baz }; to be consistent with the usual emplacing interface, e.g. optional<T> o { emplace, bar, baz };?
Why not emplace<3>?
Jan 13 at 20:26, by R. Martinho Fernandes
Ugh, German sentence structure is weird.
Changed your mind yet?
43 mins ago, by R. Martinho Fernandes
It's weird. I think I like German :|
Maybe.
08:30
@R.MartinhoFernandes You have to be careful with 'tags'. E.g. variant<std::string> v { 20, 'a' }; currently works. So what if I have a variant of a variant? (There was a similar discussion regarding std::optional and nullopt.)
lol, Coliru has a favicon now.
user142019
Hmm. JIT for template metaprogramming.
@R.MartinhoFernandes I'm sure you're aware how it works by now, but I have to say I positively love 'stuff I want to put the emphasis on + verb + remainder' as structure!
And the remainder breaks down too.
08:33
@R.MartinhoFernandes In what way?
Subjekt, Angabe, Ergänzung, Something here I don't remember, Ergänzung2, Verb2.
And then trennbare Verben.
user142019
@user1879104 I heard @Mysticial is a good one.
user142019
Ohai @TheForestAndtheTrees.
@LucDanton I'm still trying to get used to having verb before subject.
08:36
Is Ergänzung direct and the other one indirect?
@LucDanton Direct vs indirect is Akkusativ vs something else, no?
@R.MartinhoFernandes The way I was taught is 'verb in second place, subject next to verb'.
@R.MartinhoFernandes Dativ, yes. Dunno what Ergänzung2 is then I think.
@LucDanton Some verbs take two.
user142019
Man.
Can't think of an example off-hand. I saw that in passing in the book.
user142019
08:37
The train is overflowing with humans.
@LucDanton Yeah, but "next to verb" can be before or after.
@R.MartinhoFernandes Yeah! It's the freedom I like!
How quickly have you been immersed in German btw? You seem to be going very fast.
In Portuguese verb before subject means that 1) you can't speak properly; 2) you are drunk; or 3) are you a poet, which does not invalidate the other two.
And my brain has that wired quite strongly, it seems.
No leeway at all? There's some in French, perhaps that's why it wasn't as much as a hang-up?
@LucDanton I have been taking intensive courses, 3 hours a day, 4 days a week since January.
08:40
@R.MartinhoFernandes And before you moved?
@LucDanton numbers, days of the week, and phonemes.
I've kinda assumed you had some knowledge of Germanic languages in general, beyond English. Perhaps not as a speaker or would-be speaker, but from e.g. linguistic curiosity.
@R.MartinhoFernandes Ah, I tend to fixate on grammars first.
@LucDanton There are some specific grammatical forms with verb before subject (like imperative forms, or some colloquial answers), but that's it.
Oh okay. I won't bore you with French, I suppose you already know some examples here.
"Subject -> verb -> everything else" is the basic structure. And "everything else" has pretty much no rules. Just drop stuff there as go.
08:46
I kinda do the same with German tbh. As long as it's informal, I think you can swap a lot of things around.
Xeo
Xeo
Mornin'
@LucDanton Except secondary verbs and the trennbare bits come at the end.
Yes.
What's a secondary verb?
Ich kann ein Beispiel machen.
(Can I?)
08:48
Dunno. I would say that as well if I still wanted to make myself understood.
Maybe "bilden". There are way too many words with way too many similar meanings.
In any language, right? :)
Maybe.
Though I don't know any other language with so many internal false friends.
And my vocabulary is still very small.
08:52
Which ones are you thinking of? I know I tend to avoid anything with a Latin root because they either are only used formally or because they mean something else than the root suggests, if not both.
@R.MartinhoFernandes As much as I like German the truth is that I simply don't practice. I think mine is shrinking each day.
Xeo
Xeo
@Kevin, I want range-based syntax, no alternative. Without that requirement, yes it's certainly a trivial exercise and has been done many times. — devtk 1 hour ago
Gawd, some people are so fucking stubborn.
zip(r, make_range(next(begin(r)), end(r))) should be close I think?
@LucDanton The easy target here is "morgen" and "morgens", but I'll let that one slide. I have seen various verbs that you add a trennbare bit and it becomes something entirely unlike the original.
(Can refactor the make_range(/* stuff */) so that it's clearer I guess.)
Xeo
Xeo
@LucDanton ♥ zip.
08:55
@Xeo that sounds like a euphemism
morning mateys
@R.MartinhoFernandes English has the latter though, although not to the same extent. Also I didn't know those counted as false friends! Yeah, rection des verbes is a painstaking and slow learning process for most.
@Xeo That's just a crutch for lack of scan.
oh, who finally unpinned the cats hate?
Sorry, I don't get the morgen / morgens bit :( it is consistent with e.g. abend / abends, putting aside the homonymy.
@LucDanton No, it's not. "morgen" is "tomorrow".
Oh, wait it gets worse.
"morgen" => "tomorrow", "Morgen" => "morning". Can you tell the difference?
08:59
Yes.

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