« first day (472 days earlier)      last day (4476 days later) » 

12:00 AM
@Mysticial What exactly are you taking exception to?
 
nevermind
 
@RMartinhoFernandes Where are you reading this?
 
@RMartinhoFernandes Thanks
 
I can't find a more recent one though.
 
12:01 AM
@RMartinhoFernandes Thanks!
 
But I doubt that part suffered any major changes.
The recent additions are not about the type system.
template<typename T> inline T implicit_cast(const T& t) { return t; }
Comment.
 
@RMartinhoFernandes it just makes a copy of it's parameter? But is... poorly named?
 
@LucDanton Random!
 
I have to ask: why a pear?
 
12:11 AM
@RMartinhoFernandes It's a const cast? Without the const?
 
(That's a laughing pear, right?)
 
@RMartinhoFernandes std::make_pear.
 
Yes, from somewhere in Spain.
 
Hmm, so, you're not getting the purpose of that code?
It's not mine, btw, found it in a comment.
 
@RMartinhoFernandes I mean, it can't really work with deduction, can it?
Pear and Loathing in Las Vegas?
 
12:13 AM
lol
implicit_cast<string (*)(int)>(&to_string)
I'm trying to decide if it's neat, or stupid.
 
It's neat for C++03, since no template aliases.
 
@RMartinhoFernandes Oh, we are using vim.
 
Name's silly though.
 
@Moshe Then try Ctrl+N, Ctrl+P, kid. There's your rudimentary-works-anywhere-completion.
You can get better stuff with plugins, but that works out of the box.
 
@RMartinhoFernandes On Mac, so command, but yea.
 
12:16 AM
And stop dissing vim.
 
Not dissing it. Loving it so far.
 
@LucDanton I don't understand. You can't alias a function template.
 
@RMartinhoFernandes I still don't understand the point
 
@RMartinhoFernandes alias<string(*)(int)>(&to_string)
 
@LucDanton Oh, right.
@MooingDuck (string(*)(int))(&to_string) is dangerous because it can reinterpret_cast on you.
 
12:19 AM
@RMartinhoFernandes everytime I think I'm above average with C++, you open your mouth. Now I have to go read more stuff
 
Well, no.
 
Could be worse @MooingDuck, I feel completely useless looking at some of you guys here!
 
The only reason you'd use that
is when the name is overloaded.
 
I just avoid talking about C++.
 
@RMartinhoFernandes why would one cast a function pointer?
 
12:20 AM
@LucDanton Right, but the poster was afraid of typoing into a non-overloaded function. (Yes, paranoid)
@MooingDuck To pick the right overload.
 
@RMartinhoFernandes ooooh
 
Xeo
0
A: C++1y Modules and the C++ ABI

XeoUp front: Modules have nothing to do with the application binary interface (ABI). Modules are what Java, C#, and a lot of other modern languages offer. They immensely reduce compile time simply because the code that's in today's header doesn't have to be parsed over and over again, everytime it'...

Anything I'm missing here? Or any misinformation?
 
Is that title a typo? y isn't anywhere close to 1.
 
Well, both C#'s and Java's "modules" are actually part of their ABI.
 
Xeo
@Mysticial C++11 doesn't have modules. It's a proposal for C++Next
 
12:23 AM
@Mysticial it's a somewhat common "name" for the C++ after C++11
 
ah...
 
C++11 was C++0x, so the "next" is C++1y
 
I think C++2x would be much more realistic.
 
@RMartinhoFernandes Makes sense. Somewhat.
 
12:23 AM
@RMartinhoFernandes C++3α, C++4β. We'll just go through the greek alphabet
 
Xeo
@RMartinhoFernandes Oh? But that won't be easy to do for C++. Though the proposal author hopes for portability of module files, IMHO it's pretty unrealistic
 
Sure, I agree with that.
 
I would've expected it to be called something like C++1x
 
Not fancy enough.
 
@Mysticial it's an online community, be real
 
12:24 AM
C++1wtf
Or, better yet, C++LOL.
 
@Xeo Well, actually, scratch that.
 
@MooingDuck lol, I would've though it was a bunch of overly formal guys...
 
MonoTouch compiles C# to native iOS thingies, not .NET DLLs.
 
Xeo
@RMartinhoFernandes Anyways, removed the first sentence
 
With the printed edition of next C++ standard, you'll be able to fight bears.
 
12:25 AM
@Mysticial they probably call it C++2x or something
 
So, the ABI part is defined by the CLI, not C#.
 
@MooingDuck Do we want to wait 10 years for the next C++ standard?
 
was playing around with template template parameters in 4.6.1, and started to get very strange link errors (changed each time I linked) - after 10 minutes of trying, I gave up, made clean, and everything built fine... ...guess the dependency checking's not smart enough for some template functionality yet...
 
Xeo
@CatPlusPlus Or use it as an alternative seat.
 
*8 years
 
12:26 AM
@Mysticial do you have a choice? And how much do you want the language to keep changing? Theoretically shouldn't it "mature" and change less and less?
 
Xeo
The C++ standards committee atleast hopes for 5 years
And a TR2 in between
@MooingDuck No, please not. I don't want C++ to become stale like C
 
@MooingDuck Theoretically. Look at C#.
 
...and I was wondering why Google rebuilds all their C++ code from source every time... ...now, I know
 
@RMartinhoFernandes Different. C# keeps adding on features because it's essentially a commercial language. If the C# team stops adding stuff, they'll have no job tomorrow.
 
@EtiennedeMartel They could go change bugs in VS/MSVC. They'll have plenty of work to do there.
Yes, I wrote "change bugs" on purpose.
 
12:29 AM
@RMartinhoFernandes move the the bugs?
 
std::move(bugs);
 
@MooingDuck No, trade them for new ones.
 
std::swap(old_bugs, new_bugs);
 
I'm soooo good.
 
12:31 AM
Bug: no ADL.
 
@Xeo ping
 
for( auto b : bugs ) { unit_test.squish( b ); }
 
Xeo
@FredOverflow Oh hai!
 
@kfmfe04 but then they'd be jobless
 
Xeo
12:32 AM
@kfmfe04 b.squish(unit_test) FTFY
 
"Plink". The technical term is "plink".
 
@RMartinhoFernandes thefreedictionary.com/plink Plink: To shoot casually at random targets.
 
thefreedictionary.com is not an accredited reference of Lounge<C++> technical terms.
 
Says who?
 
Xeo
@MooingDuck C++ casually shoots at random feet.
 
12:34 AM
@Xeo How can I help you?
 
@RMartinhoFernandes The first definition was "To cause to make a soft, sharp, metallic sound; clink."
 
Dammit, now I'm the one looking like a fool.
 
Xeo
@FredO, I think I know why linked lists and all derivates (maps) are so popular in functional languages.. it's free to implement immutable, consable containers with that. :( And I realized that immutable_vector won't be easily consable, because it'd lose the random-access nature if you don't actually realloc the array, and at the same time, old references would be invalidated just by consing the vector. :(
 
@Xeo No, it does so with extreme prejudice.
 
@Xeo Clojure does a nice job of immutable vectors, but they are actually tries.
In computer science, a trie, or prefix tree, is an ordered tree data structure that is used to store an associative array where the keys are usually strings. Unlike a binary search tree, no node in the tree stores the key associated with that node; instead, its position in the tree defines the key it is associated with. All the descendants of a node have a common prefix of the string associated with that node, and the root is associated with the empty string. Values are normally not associated with every node, only with leaves and some inner nodes that correspond to keys of interest. T...
 
12:37 AM
IMO, mutability and immutability is a stupid topic
it's a trivial container detail
don't like it? write your own, simple as
there's nothing stopping any given language providing both forms
 
Xeo
@DeadMG That's what we're talking about. Immutable containers library in C++.
 
as such, I honestly don't see why anyone cares about what form a language provides out of the box
3 mins ago, by Xeo
@FredO, I think I know why linked lists and all derivates (maps) are so popular in functional languages.. it's free to implement immutable, consable containers with that. :( And I realized that immutable_vector won't be easily consable, because it'd lose the random-access nature if you don't actually realloc the array, and at the same time, old references would be invalidated just by consing the vector. :(
dang, permalink?
 
Xeo
@DeadMG That was just an assessment of my own.
 
ok
well, if you have a hard-on for immutability, then knock yourself out
there's no reason at all that it could not be done
 
Xeo
@FredOverflow I don't get tries. I read that article so many times, and I still don't quite get them.
 
12:40 AM
Question (sanity check): std::vector<> takes 2 parameters, std::set<> takes 3 parameters. In the context of using containers as a template parameter, I can't use either std::vector<> or std::set<>, correct? In other words, my container passed in has to have the same number of parameters?
 
Xeo
@kfmfe04 ? template<template<class, class> class Cont> ?
 
@Xeo yes
 
@kfmfe04 Just use a template<typename Container> ...
 
Xeo
Aye
 
@Xeo that Cont
 
12:40 AM
@Xeo look at the picture on the right, that's the important part. The rest is just details
 
Xeo
But With C++11 template<template<class...> class Cont> :>
 
@Xeo It's just a tree of prefixes. The value for key abcd can be found by following branches a, then b, then c, and then d.
 
@RMartinhoFernandes that works better with letters so it's obvious those are not indecies (though they could be for decimal digits)
 
tries are O(n) in the key length lookup, insertion, and removal, I believe
 
@MooingDuck Right, fixed.
 
12:42 AM
@FredOverflow if I do that, I need to qualify its guts, right? like MyWrapper< set<int> >? I would like to say something like MyWrapper< int, std::set > and MyWrapper< int, std::vector >
 
Xeo
@FredOverflow Anyways, that'd lose the contiguous storage nature of a vector
 
@kfmfe04 Template aliases to the rescue!
 
@kfmfe04 Do MyWrapper<std::vector<int>> and inside use T::value_type.
 
@Xeo That's an irrelevant C-compatibility
 
@kfmfe04 how would you instantiate an object with an unknown number of template parameters? You have to do one other the other
 
12:43 AM
doesn't need to actually exist
something like deque would make a perfectly fine general-purpose random-access container for most uses
 
@RMartinhoFernandes ack- 4.7! I'm at 4.6.1
 
Xeo
@DeadMG Well, I like my vectors to be contiguous, thanks.
 
You don't need aliases for this.
 
Alias the shit out of your code.
 
ok - give me 10 min to properly post this as an SO question - brb
 
12:44 AM
That'll teach it.
 
@CatPlusPlus If you want to instantiate the template with different type arguments, yes, you do.
 
@Xeo Sure, but there's no need to actually have a vector as Standard
 
Gah. All containers have value_type typedef.
So you can do it the other way around.
 
@Xeo tries are nested hashtables, where each "tier" uses sequential "parts" of the key.
 
12:46 AM
@CatPlusPlus How?
 
"I would like to say something like MyWrapper< int, std::set > and MyWrapper< int, std::vector >"
Then say MyWrapper<std::set<int>> and get int from T::value_type.
 
@CatPlusPlus that's where subcontainer::rebind<int>::other would have been handy.
hmm. template<class container, class value_type> struct rebind {typename /*specialize here*/ other;}; +specializations
 
The more I look at it the worse that idea is to me
 
Xeo
@MooingDuck It is. Much worse. I played around with a general template parameter rebinding functionality. Damn, that gets tiring.
Better try to hack something together with boost::mpl::transform or boost::mpl:replace or something
 
12:51 AM
@Xeo or what CatPlusPlus said
 
Xeo
Aye
 
Hmm... ...maybe I can just "skirt my problem" by using set and multiset (instead of set and vector)...
 
Hm, the Scons file for V8 builds it with -Wall -Werror. That's some dedication right there.
 
Actually, for what I was doing at least, what CatPlusPlus suggested wouldn't work because I wanted to use a different internal value_type. But then I realized what I was thinking was unimplimentable in other ways too, so stopped
 
Maybe let's start with what you're trying to achieve.
 
12:52 AM
...rubber ducky debugging at work...
 
Yes, tell us how you feel.
 
I'm a rubber cat.
 
hahaha
 
Squick.
 
@MooingDuck OMG, it worked. ideone.com/XmYl8
 
12:53 AM
@RMartinhoFernandes why wouldn't it? It's still a bad idea
 
ok - I have two variants that I'm looking to create, let's call them A and B
A will hold a bunch of unique elements (where set would be useful) and takes 4 arguments when loading from the database.
 
assert should be available without headers.
 
B will hold a bunch of elements (don't care about uniqueness) and takes 5 arguments when loading from the database.
 
Xeo
If you are new here, please read the newbie hints. Thank you.
20
 
12:55 AM
Oooh, new Overgrowth dev video.
 
Besides these two features, the API is identical. The 4 argument object type is X and the 5 argument object type is Y.
 
@CatPlusPlus Linky please.
 
More graphical bunny violence in great detail.
 
ok - lemme code this up (but by the time I do it, the answer will prolly pop out) 8^)
hence, rubber ducky - be back in a bit
 
I'm really impressed by their tools.
Oooh, nice "crack" sound when he hits the wall.
 
12:56 AM
Lol at 0:51.
 
@RMartinhoFernandes that is way simplier than what I was thinking ideone.com/3PG9q works on vector and map. Prettier with variadics probably. (Though I only rebind the ke of a map)
 
@MooingDuck lol
wall of templates!
 
Xeo
@MooingDuck For maps, it would be best to see them as 3-arg templates, with the first arg as a pair<Key,Value> for transformation purposes only
IMHO, anyways
 
@Xeo yeah, I was thinking that there needed to be something else for map, but didn't finish the thought.
 
1:03 AM
"How To Use SSH on Mac OS X": First, you need to install a real OS.
Then, SSH works.
 
@Moshe "SSH is more responsible about web security than I am. "
 
So, you're giving your login details to remote machine, but blurry out volatile ISP info?
 
@CatPlusPlus he doesn't show his pass, that's... something
 
@MooingDuck Hey, I hate you. I sooo don't want to be messing with this crap, but now you spurred it :( ideone.com/sF5zT
 
@RMartinhoFernandes what about map? :D
 
1:07 AM
> Intermediate and Advanced Programming Techniques > Recursion > defining recursive functions
Right.
 
@CatPlusPlus recursive functions are easy. A recursive function is a function that is recursive.
 
@MooingDuck As it is, it rebinds the key and keeps the value intact, just like yours.
 
@RMartinhoFernandes so if I make a broken version you'll be unable to log off until you fix it?
 
Giving me challenges when I'm bored is dangerous. To me.
 
Xeo
@RMartinhoFernandes It's strange how alluring templates can be, huh?
 
1:10 AM
@Xeo Yeah, I'm already thinking of a way to rebind arbitrary parameters.
Like, rebind only the values of a map.
 
Xeo
Hrhr, like I said, I played with that once.
 
@MooingDuck :-D
 
Please tell me to stop.
 
Xeo
But it gets very tiring very fast
 
This guy makes me regret answering his question...
 
1:11 AM
@CatPlusPlus Yup. I need that info so people can understand what the beep I'm talking about.
 
@RMartinhoFernandes I can't think of how to do it without SFINAE, and I have yet to SFINAE correctly
 
Matrices again, huh.
 
Xeo
@RMartinhoFernandes No.
 
Why is everyone writing matrix classes.
 
Xeo
For the heck of it.
 
1:13 AM
Ha! I stopped it.
 
@CatPlusPlus new semester just started
 
@RMartinhoFernandes I borke it! ideone.com/sF5zT
 
I never had to write a matrix class for... well, class.
 
@CatPlusPlus One of his offensive comments has already been deleted...
 
Xeo
1:14 AM
@RMartinhoFernandes Make it possible to do rebind<map_type, pair<_1, int>>::type to rebind the value
 
he got angry about the difference between t and *t, alas.
 
@Xeo I was thinking of a sweeter interface.
 
@Xeo but what if you want to rebind vector<int> to vector<pair<int, char>>?
 
rebind<map_type, _, int>::type
 
Xeo
@RMartinhoFernandes That would only rebind the key, no?
Or every type?
Or what exactly? :P
 
1:15 AM
@KerrekSB Only the strongest can survive the trial of the nitpicker brigade.
:P
 
@Xeo There's a _ placeholder for the key.
It's supposed to rebind the value. I.e., transform map<char, double> into map<char, int>.
 
Xeo
@MooingDuck rebind<vec_type, pair<int, char>>
 
Anyone know if combination expression is synonymous with s-expression?
 
Hmm, sexps.
@Xeo But the variadic gymnastics to pull that off got me the respite I needed to stop trying.
 
Xeo
Hrhr
 
1:18 AM
@RMartinhoFernandes Definition for combination is, Expressions such as these, formed by delimiting a list of expressions within parentheses in order to denote procedure application, are called combinations. Same as sexps?
 
Oh, don't ask me.
 
@Xeo oh, where _1 is a magic placeholder type?
 
@CatPlusPlus so what is a real OS?
 
Xeo
@MooingDuck Something like that
 
Something that isn't OSX.
 
1:19 AM
DOS?
 
"assburgers", lol!
 
Well, it had better UI.
 
Windoze 98?
 
That sounds like a drug.
 
@RMartinhoFernandes easiest just to give the map (and similar) a seperate rebind_map thing
 
1:20 AM
I would tend to agree that MacOS isn't "real OS", but I think OSX, as a FreeBSD variant, is quite good
 
Xeo
@kfmfe04 lol
 
@MooingDuck But writing that has no appeal.
 
I had to use OSX few times, and ugh.
 
It's a bit quirky how things are set up, but like any OS different from the one you are currently using, it's going to be different...
...for some strange reasons, engineers always think they can "do it better" than the next guy
 
Are you using "different" here as an euphemism for "crippled" or "retarded", or with its literal meaning?
 
1:22 AM
literal
 
@CatPlusPlus I got a mac. After a month I shrunk the mac partition to about 20G, and made the rest Windows. I will never again buy a mac
 
Ok, just checking for sarcasm.
 
wut? sarcasm at Lounge<C++>?
 
@RMartinhoFernandes he's the one defending macOSX
 
I think any OS is fine if I can get it to do what I need to do...
...if not, it could be me, it could be the OS
 
1:23 AM
I own a Mac. Pretty satisfied so far. Except for the fact that Xcode does not ship with a C++11-compliant compiler.
(By "compliant", I mean "relatively compliant")
 
@RMartinhoFernandes return sarcasm ? true : false;
 
return !!sarcasm; if not bool.
 
Xeo
@CatPlusPlus Overloaded sarcasm::operator! to return !!. Y'know, sarcastic sarcasm.
 
@EtiennedeMartel agreed - I like llvm - the little I've seen of it... ...one of these days, may have to switch from gcc -> llvm
 
Wait, wut?
@Moshe return sarcasm; // stop being silly
 
1:25 AM
I said "if not bool".
 
Xeo
@EtiennedeMartel Doesn't xcode 4 include Clang?
 
return true;
 
lol
 
return !!!false;
 
would be hilarious if Lounge<C++> will not echo any text unless it's C++11 compliant!
 
1:26 AM
@Xeo Right, which has no lambdas.
 
Xeo
@RMartinhoFernandes Damn it, robot. Stop picking on the lambdas!
 
Hey, I love clang just as much as you do... wait, I don't think I love it as much as you do (I mean, come on, you're practically compiling it on a daily basis, that's gotta be love). But I like it a lot. When it can compile my code, I'll switch to it.
 
@RMartinhoFernandes exactly my sentiments!
show me the binary
Xeo has a background process that continuously compiles clang, methinks
 
One line changed in the latest revision? FULL REBUILD.
 
Pity "compile" doesn't work as a sexual pun in English.
 
1:29 AM
Everything does.
 
lol
 
You're just not trying hard enough.
 
Xeo
@RMartinhoFernandes But "link" does. Link two people and a third one comes out of it.
 
cat's right 8^)
 
@CatPlusPlus Nice one.
 
1:31 AM
cumpile would work (nasty thought)
 
Xeo
@kfmfe04 No, that'd kill my PC performance. :/
 
@Xeo btw, have you started playing with clang?
 
Xeo
@kfmfe04 What exactly do you mean?
 
@Xeo well, you built it to try stuff, right?
 
You know, "playing".
 
Xeo
1:32 AM
@kfmfe04 Sure. Random template stuff, mostly.
 
no sarcasm or double entendres here
 
Xeo
Like my folder structure code
 
@Xeo ah - ok - just wondering what you like/don't like about it so far
 
Xeo
@kfmfe04 I don't like that it has no initializer lists and lambdas. :(
 
The Two Things about Web programming (as it is mostly done in the real world):
1) Control-C
2) Control-V
 
1:34 AM
ack - I ran across no initializer lists while trying to compile my code...
 
Xeo
0
Q: Does 'delete pointer' simply mean '*pointer = 0'?

Avinash Sonawane# include <iostream> int main() { using std::cout; int *p= new int; *p = 10; cout<<*p<<"\t"<<p<<"\n"; delete p; cout<<*p<<"\t"<<p<<"\n"; return 0; } Output: 10 0x237c010 0 0x237c010 Here after deleting p, why the pointer p reta...

The fuck.
@kfmfe04 It's in the making though. Same with lambdas (they're syntactically recognized already and you get a nice "lambdas not supported yet" error)
 
@Xeo - also, I googled around a bit - you were right about my fault in not getting boost to work with clang - I haven't verified it with my own compile yet (afraid of bashing my current setup), but apparently, I need to recompile all of boost with clang (why I was having boost clang issues a few days back)
 
Xeo
Of course. Clang's not ABI compatible with GCC except for some lowlevel stuff like allocations or something
 
@Xeo clang error messages, good stuff - yummy
 
Xeo
Absolutely
Maybe a bit verbose sometimes, though, thanks to their triple-line nature
 
1:37 AM
much better than the pile of #('$ that gcc spews out
 
Xeo
Sometimes 4lines even, if they suggest a semicolon or something
That in any case.
 
@kfmfe04 It only looks like that if you don't speak GCC-errorese.
 
actually, my mind/eyes have already been trained to automatically filter out all except the code and line-number for GCC-errors - I only parse the rest when I really need to
 
Xeo
Dec 11 '11 at 17:59, by rubenvb
The difference between GCC and Clang errors: Clang starts with the thing causing it, GCC ends with it (if you're lucky).
 
having said that, I still like them clang errors
 
1:39 AM
@Xeo Order is not the biggest the problem.
@kfmfe04 Oh, don't get the idea I like GCC errors (proof chat.stackoverflow.com/transcript/10?m=2454090#2454090).
 
verbosity
 
Xeo
Well, GCC's error message order is nice for terminals, though
 
@kfmfe04 Right, because clang is less verbose.
 
can't blame GCC for not being explicit...
 
GCC is not usefully explicit.
 
1:41 AM
hahaha - I like your qualifier
 
Stuff like ((int&)*((int*)&42)) don't help.
 
So much fail.
 
And that's just something that's produced for temporaries bound to references.
 
Xeo
'blub' (aka 'blargnarfubble')
 
GCC akas types as well.
 
Xeo
1:42 AM
Yeah, but it's dumb while doing that
 
Define dumb.
 
Dumb: what GCC does.
 
Fair enough, I agree it's dumb then.
 
void dumb = What GCC does
 
@RMartinhoFernandes If you do complicated_expression(with)[intermediate].calls() with dependent types then the type of that is... the type of the expression.
 
1:52 AM
Wait, what?
 
When you do something invalid with such an expression (e.g. calling an inexistent member) then the error is of the kind "request for member foo but type complicated_expression(with)[intermediate].calls() doesn't have such a member" or something like that.
 
Xeo
Well then, I'm off to sleep. G'night.
 
gn
 

« first day (472 days earlier)      last day (4476 days later) »