« first day (236 days earlier)      last day (4703 days later) » 

4:00 AM
Be politically correct. LOL
 
Xeo
So much for returning stuff nobody expects: ideone.com/QIHNY
 
@Potatoswatter That's more of an effect of call by name vs call by value isn't it? Call frames or no call frames is a detail in the implementations.
 
Xeo
I should modify both the caller and the callee
But this is awesome. No downcasting!
 
@LucDanton Call by name vs call by value relates to passed arguments. Local variables are a separate semantic.
But yeah, I guess those go hand-in-hand.
 
@Potatoswatter You're right, this has nothing to do with it. It's global vs local.
My compilations are getting faster and faster the more I add code. This is probably a sign that I should go to sleep.
2
 
Xeo
4:07 AM
lol
 
@Xeo: You could implement a std::set of thunk objects in the exception state. Remove a thunk and run it until it throws another thunk, which you put into the pool. Then grab the next one from the pool.
Voila, exception-based multithreading.
 
Xeo
Don't give me weird ideas, I won't be able to concentrate on the lessons today!
 
I'm never gonna concentrate on my exam
 
Xeo
Meh! I want to have non-type template parameters of references to local objects!
 
@Xeo How would that be compiled?
 
4:16 AM
JIT, obviously
 
You can kinda do it with std::placeholders
 
Quick question: I'm an "ok" programmer. Got my BS in CS a couple of years ago. I know about control structures and OO methodologies. I never really learned C, always done Java. I want to learn C++ so I can to more "close to the metal" stuff. Should I focus on really learning C first, and THEN C++, or can I just get a good book on C++ and go from there?
 
really, don't learn C first
it has nothing to offer C++
 
Okay. Simple answer. :-)
 
@loneboat What does "close to the metal" mean to you?
What is the career goal?
 
4:18 AM
I wanna do some OpenGL stuff.
 
there are Java wrappers for OGL
 
Career goal? $5m by 2014.
Yeah, I know about the wrappers. I want to do some native stuff, though.
 
Yeah, I don't see how either C or C++ is relevant here. OpenGL is a completely separate technology.
OpenGL by definition isn't native, it's a compatibility layer.
 
well, don't bother with C
 
If you want to write directly for GPUs, then you'll likely be stuck with a highly-modified version of C.
 
4:20 AM
Oh. Well, anyway, OGL was only one example (even if I am wrong about it). Really I just want to try another language and see how it feels.
ANSI how it feels.
heh
 
C++ will feel very different to Java
if you approach it to Java-but-compiled-to-machine-code, you won't get far
 
Yeah, that's kind of what I'm hoping for. Something outside my box of experience.
 
Yeah, we don't pack our algorithms in classes, for one.
 
Well, you're obviously asking C++ partisans here. For what it's worth, most of my professional work has been in C and it hasn't killed me.
 
grumpy
 
4:21 AM
hello all
 
Also closer to the metal is not that much of a good thing.
Bloody assembler.
 
@CatPlusPlus You're just being tortured pointlessly…
 
I know practically nothing about the relationship of C to C++ other than the great Wikipedia says "C++ is a superset of C". What is their relationship?
 
Well, that's pretty much the definition of life.
 
Really close to the metal stuff is done in assembler or C, because it works with a lighter execution environment.
 
4:22 AM
@loneboat C sucks, C++ doesn't.
 
Oh, good diff.
 
@loneboat: Basically, C and C++ are kinda similar, except C hasn't evolved since 1990
 
Well, not as much, at least.
 
C++ has very significant generic code (templates) and OO, whereas C has nothing
 
LOL. I'm not even gonna try to fix this bias…
 
4:23 AM
C has no safety, no nothing
 
Also C++ is not a strict superset of C, C has some features that aren't in C++ (VLAs and something else I'm probably forgetting).
 
there are a few obscure literal types that C99 has
 
C works when you know exactly what you want and how to get it. If you don't need much abstraction and resources are tight, it's what you want.
 
@CatPlusPlus C++ is a superset of C89
 
My sentences are broken by the horrors of assembly.
 
4:24 AM
along with a couple other things I never saw any use for
 
Or if you are willing to work hard and walk the to achieve the abstraction you need.
 
@LucDanton Yeah, but C89 sucks even more than C99.
 
@PotatoSwatter: Except nobody is forcing you to use any of the abstractions that C++ offers
especially the run-time abstractions
the tight resources of the execution machine is an excellent reason to use C++, since templates will offer compile-time evaluation where C would have to offer run-time
 
I mean, can't mix the definitions and code, really? And loop variables outside of the loop?
 
@LucDanton C++ is a superset of C circa 1981, and not even really that… the languages diverged long ago.
I'm surprised if Wikipedia really says that.
 
4:25 AM
quintessential example, qsort vs std::sort
 
Real C programmers invent their own stdlib.
 
there's a good C++ books question on SO
I don't have a link but you could search
 
[c++-faq] books
 
Could you write me an assembler program to search? I want it FAST.
 
4:26 AM
@CatPlusPlus Meh. There isn't that much people using the really innovative features of C99 so practically you're going to use C89 minus the horrible declarations at block start. If you mean the library additions then it's probably a bad idea to use any kind of C without nice libraries on the side.
 
@CatPlusPlus I wrote my own stdlib for C++ when I was just getting started in it… it worked with Apple MrCpp and Metrowerks C++… I had no idea that people didn't just do that.
 
@Potatoswatter The C++ Standard refers to the C Standard for C89
 
@LucDanton It's the little things.
 
@Luc: Referring to specific sections doesn't make the core language a superset.
 
@LucDanton: In my opinion, it's a larger crime to refer to the C Standard at all
 
4:27 AM
'specific' ?
 
It only means the intersection of the libraries is non-empty, which is quite a far cry.
 
502
Q: The Definitive C++ Book Guide and List

grepsedawk This question has historical significance, but is not a good example of an appropriate question. Read and learn from this post, but please do not use it as evidence that you can ask similar questions. See the FAQ for more info. Provide QUALITY books and an approximate skill level. Add ...

 
also, I've got to ask- what innovative features of C99?
 
Cat++: Thanks!
 
f((S) { .n = stuff, .callback = thunk }); IIRC
Can take the address, too!
 
4:29 AM
@LucDanton: What on earth is that? I've been bitched at by many people for suggesting that C sucks, and none of them have ever put forward anything even remotely like that
 
Xeo
You know, C1X is kinda funny
 
so excuse me, but I've just never seen that syntax and do't really know wtf it is or des
 
Xeo
#define cbrt(X) _Generic((X), long double: cbrtl, \
                              default: cbrt, \
                              float: cbrtf)(X)
 
@Xeo ugh… kill it with fire…
 
Xeo
@DeadMG name-wise initialization of struct members
 
4:31 AM
so
function-call( (struct-name) { member = initializer, ... });
 
Xeo
struct S{ int n; float f; };

struct S s = { .f = 3.14f, .n = 1337 };
 
@DeadMG It's an inline notation for a creating types on the fly. Here's it's a struct and I'm using C99 initializers, too.
 
Xeo
@LucDanton Oh, even creating structs on the fly? That's kinda nice.
 
@Xeo Better typedef that struct S to S : this is C after all.
You can take the address and as a bonus if the type is const the Standard permits reusing the address.
 
Xeo
But you know, that _Generic from C1X would be a nice addition to C++. Finally branching on template parameters!
With the C preprocessor
If I got that right what it does
 
4:33 AM
ugh, I'd be happier with the current specialization system
 
@Xeo You couldn't branch on a template parameter because its type is unknown until instantiation.
Anyway, templates already do that, which is quite the point.
 
Xeo
Meh, C++ needs to combine templates and the preprocessor in some way so you can conditionally compile stuff on template parameters
11
Q: Conditional compile-time inclusion/exclusion of code based on template argument(s)?

XeoConsider the following class, with the inner struct Y being used as a type, eg. in templates, later on: template<int I> class X{ template<class T1> struct Y{}; template<class T1, class T2> struct Y{}; }; Now, this example will obviously not compile, with the error th...

 
it just needs to ditch the preprocessor and have conditional compilation for templates
 
Is this about static_if again?
 
but then, now you're talking about a new language, really
 
4:35 AM
@Xeo Use a bool nontype argument… where does the preprocessor come in?
 
Xeo
@LucDanton @Johannes had a funny implementation of static_if a while ago
 
fuck, man
it's still another three and a half hours till my exam and my head is already hitting the desk
 
Xeo
Only drawback was that you couldn't return from the branch
room topic changed to Lounge<C++>: Because sleep is overrated.
 
Hmm, that problem looks more like a job for a parameter pack.
 
Xeo
I stopped reading the C1X wiki page after this
 
4:40 AM
yeah
 
Xeo
> More macros
 
static_assert(sizeof...(T) == I, "...");
 
Hey, I got an idea to emulate a parameter pack in C++03
 
Xeo
@Potatoswatter Does it have to do with exceptions, TLS and type-erasure?
 
lol
 
4:41 AM
@Xeo No, just template template parameters
 
Xeo
How lame...
 
what, template<template<template<template<template<template...?
 
Xeo
lawl
> Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo
One can always emulate parameter packs with typelists
 
@DeadMG well, that's obviously what we specifically want to avoid…
 
be fuckin' hilarious though
with a ™ on the end
 
4:46 AM
@Xeo Bah, that's actually all my idea was. No template template parameters needed.
 
Fuckin' High-Larious™
 
chillin' ☃
 
by the way
lack of sleep appears to be significantly impairing my cognitive function
 
Xeo
I love it when I can simply answer "SFINAE" to certain questions.
Wow, now we get advertisement bots on SO...
 
@Xeo The OP is not interested in floating-point types.
 
Xeo
4:55 AM
@LucDanton He is.
> i just want the function to work when T is some form of an int (and float if possible)
 
I didn't spot that contradiction!
 
Xeo
@DeadMG: I find a macro cleaner with enable_ifs
 
Have you tried the C++0x new style?
 
Xeo
trailing-return ?
 
Xeo
4:56 AM
? oO
 
These days I typically write my templates like so
 
Xeo
Ah, right, SFINAE in template parameters
 
Hello.
 
@Xeo and also all sorts of intermediate computations
 
room topic changed to Lounge<C++>: ☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃
Ha; the snowmen look like they are falling over.
This is all @Potatoswatter's fault.
 
5:04 AM
@JamesMcNellis It is early June, what do you expect?
Lounge<C++>: Land of the flaccid snowmen.
 
Incredible. I've finished and it works. At least for 2x2 * 2x2. It will probably break for other stuff, but hey, I can act all surprised then.
 
A 2x2 sparse matrix?
 
I also kinda lie about them being sparse.
But hey, it works, right.
 
0_o
If they aren't sparse, why was it so much work?
anyway… nevermind… get some sleep
 
Well, rows are converted to sparse vectors, so there's a word 'sparse' in the source.
Sleep? Hah. I've a class in two hours.
Java on a paper this time.
 
5:12 AM
@Xeo: answered your question…
 
These things keep getting more and more ridiculous. I'm so happy that I'll be working with Python.
room topic changed to Lounge<C++>: 🚅☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃
 
hi all
I need a little help.. Please guide me
 
Yes, there's a train engine character in Unicode.
 
I am getting error: LINK : fatal error LNK1104: cannot open file "Debug/lLoadPicture.exe"
imy exe is not running.
 
Xeo
@Miss, I thought you never wanted to come back?
 
5:23 AM
Can you delete it manually?
 
i scanned my system but still not resove my problem ..
 
Get Unlocker, it will tell you if something has open handles on that file.
 
@Xeo Please if you do't want to reply me then jsut ignore me . not need to tell me
ok
Can any one help me please
@lucdanton: are you there ? CAn you please guide me regarding the abive problem
 
@CatPlusPlus It's a box with "01F685" inside for me. But that looks about as much to me like a train engine as the train looks like snowmen, rather than ladybugs.
 
5:27 AM
@CatPlusPlus Wow, that's incredibly specific!
 
@CatPlusPlus Why is the image also a box?
 
I mean, what the hell were they thinking. "— Oh, we need to add more things to 6.0. — How about TRAINS?"
 
LOL "DIRECTIONALITY_UNDEFINED"
 
Well, it looks right to left to me.
 
@Potatoswatter Preposterous. The train should run the other way for RTL scripts!
 
5:29 AM
@LucDanton I don't know. It's not my site. :P
 
Clearly the Unicode committee has a cultural bias toward the left… let's file a petition!
U+1F694 	ONCOMING POLICE CAR
 
Xeo
What the fuck.
 
room topic changed to Lounge<C++>: 🚅☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃☃™
 
U+1F69C TRACTOR (U+1F69C) 🚜
 
It's not like the 2^32 codespace is going to fill itself.
 
5:32 AM
If Bjarne had had Unicode, this room would almost assuredly be named Lounge<C☃☃>
 
Lounge<APL>, you mean.
 
that's way better than the current snowman spam
 
PUT LITTER IN ITS PLACE SYMBOL (U+1F6AE)
 
but really, it would be nice to attend serious international committee meetings, yet smoke weed all day…
 
5:34 AM
so
who wants to put a bet on how long I'm going to sleep for when I get back from my exam?
 
Xeo
@DeadMG 6hours
 
In 2000 they met in Amsterdam :D
 
Oh, there are alchemical symbols as well.
 
Xeo
Now it's getting ridiculous.
 
And domino tiles.
 
5:37 AM
@Xeo: It was quite ridiculous beforehand
 
Horizontal and vertical.
 
Xeo
Seriously, what do they smoke and where can I get it?
 
imagine in like, 2050 when we run out of Unicode characters
 
How thoughtful.
 
they'll be like, well, what dumb fuck stuck all of this useless shit in here?
 
Xeo
5:38 AM
They'll just go with 8byte
 
And Mahjong tiles.
 
Xeo
MAHJONG!
 
CITYSCAPE AT DUSK (U+1F306)
 
Xeo
wtf.
 
5:38 AM
The irony is that it's only 21-bit, so they actually can/will fill it up through carelessness.
 
Now you have art in Unicode form.
 
@lucdanton: can you please see my problem.. thats given above
 
even Chrome won't render that
 
You people have poor fonts.
 
pretty sure that the font is determined by the CSS of the page
 
5:39 AM
Okay, that's my new favourite.
FIRST QUARTER MOON WITH FACE (U+1F31B)
 
Xeo
Sorry, but normally we do not need Unicode characters like "CITYSCAPE AT DUSK".
 
It's a first quarter moon. With a face.
 
just what the fuck
 
Ahh, vegetables.
 
Xeo
@Cat, did your brain get disassembled away or something?
 
5:40 AM
And more poetry.
LEAF FLUTTERING IN WIND (U+1F343)
 
every time you come up with something, I think that that must be it and the insanity will stop now
but then it never does
 
SLICE OF PIZZA (U+1F355)
 
Xeo
I think @Cat is actually on the Unicode Committee and shows us all the characters he managed to get in.
 
Naw, I'm just going over the list. TEACUP WITHOUT HANDLE (U+1F375)
Note that there is no TEACUP WITH HANDLE. How could they forget.
CAT (U+1F408) Awww.
 
Maybe the handle is a separate character?
 
5:43 AM
They even have a dragon.
And baby chick. In two variants.
CLOCKWISE RIGHTWARDS AND LEFTWARDS OPEN CIRCLE ARROWS WITH CIRCLED ONE OVERLAY (U+1F502)
I don't even know what that means.
 
Sounds like some kind of recycling symbol.
 
They also have 24 characters for a clock.
Yes, each points at different hour.
 
Xeo
@CatPlusPlus Wait, 24?
Tell me it's a digital clock.
 
If C++ Unicode support wasn't frustrated by EBCDIC, we could harness the power of the dragon…
 
Xeo
Yay, binary rep count!
 
5:48 AM
@Xeo 12 half-hours.
@Xeo Also, probably.
 
hey @Xeo
how long have we been sitting in this chatroom?
 
Xeo
Way too long.
 
I love our new topic. A trademarked train full of melting snowmen. Brilliance.
 
we is like well geniuses bruv
 
6:04 AM
@Xeo: I answered your question again, even better this time.
 
Xeo
Thanks, but I think I already gave up on whatever I was trying to accomplish back then. xD
 
damn it… well you'll have to pick an answer eventually
 
Xeo
Ah, I remember now what I even wanted to do
 
Have you guys seen Google's start page today?
 
Xeo
A general rebind template that can rebind arbitary template parameters
lol
 
6:14 AM
@Xeo I bet it's doable in O(N) lines of code…
alright, see y'all around…
 
Xeo
Wow. I posted an answer, edited some details in within a minute, and bam, 8 upvotes already.
Hell yeah, 11.111 rep!
 
Xeo
6:42 AM
Heaven yeah, anonymous downvotes!
 
here, have an anonymous star
 
morning y'all
 
Xeo
Mornin' @Tony
Another day, another repcap reached~
 
so early in the morning?
 
Xeo
12
A: template<> in c++

Xeotemplate<> tells the compiler that a template specialization follows, specifically a full specialization. Normally, class A would have to look something like this: template<class T> class A{ // general implementation }; template<> class A<int>{ // special implementat...

A sudden chance to earn some easy rep showed its face.
The bait was just too good to not take it.
 
6:54 AM
amagad
gotta leave for exam in 20 minutes
 
Xeo
Good luck! :)
Good luck staying awake, that is.
 
and not thinking about all those ridiculous Unicode characters
or throwing exceptions up the stack
 
Xeo
Try embedding them.
 
well if I find a question I can't answer
 
Xeo
@DeadMG With type-erasure / automated downcasting (if any)
 
6:55 AM
I'll just throw an exception
 
Xeo
throw FindAnswer(Question5);
 
and who's gonna catch your exception?
 
the examinator
pretty sure that it's supposed to be examiner
 
Xeo
exeminator
 
6:59 AM
THE EXAMINATOR! He feels no fear, or pity, or remorse! He will fail you, and he will not stop, until you have failed the year!
 
Xeo
A *nix daemon that is killing all .exe on-sight.
 
where would a Unix system even get .exes from?
wow
I put my glasses on, and now I can actually see and shit
 
@DeadMG I've seen programs launched by wrapper scripts where the program had the same name as the script but with .exe appended.
(Such scripts are used to set up LD_LIBRARY_PATH and find the installation root)
 
so then
begin funeral march
 
Xeo
hf
 
7:19 AM
hello
can some one help me with Array of Structures?
I am really stuck
 
what's up?
 
A new shiny badge.
 
7:41 AM
@sbi Uncle FAQ surely sounds wrong...
 
lol, for sure that it sounds wrong :P
 
@DeadMG A file that ends with ".exe" and that has run permissions :)
 
hello, can I ask you something bout C-lang?
anyone here?
 
No, there is nobody here.
 
7:57 AM
I'm not here...
 
@TonyTheTiger Just what I wrote.
@aerohn Ask. If you don't you are sure to get no answer.
(Not that you are certain to get one if you ask.)
 
You could also get UB!
 
8:34 AM
I am confused by the OP's last comment on my answer
1
A: tr1::bad_weak_ptr

Tony The TigerI'm guessing your usage of shared_from_this() is wrong. It should be used in a class as follows: class Y: public enable_shared_from_this<Y> { public: shared_ptr<Y> f() { return shared_from_this(); } } Then you can call y->f() to get the this pointer of the ...

anybody care to assist here?
 
Sorry, not my territory
 
Xeo
Yeah, also not my territory to help others. :P
 
@Xeo lol
 
sbi
9:14 AM
@StackedCrooked Whether "FAQ" sounds wrong depends on how you pronounce it. "Eff-Ah-Cue" doesn't sound wrong to me, at all. Of course, I'm not a native, so I might miss something, but given this room's track record I'll assume you have a dirty fantasy until I'm proven wrong.
 
9:45 AM
room topic changed to Lounge<C++>: Sorry, I just didn't like the previous room description at all.
2
I mean, seriously, a bunch of boxes and trademarked penguins? WTF?
 
Fortunately that wasn't valid Perl.
Or was it?
 
yellow..
 

« first day (236 days earlier)      last day (4703 days later) »