« first day (798 days earlier)      last day (4149 days later) » 

12:03 PM
lolwot
 
@StackedCrooked I've managed to write a buggy D3D app that causes so many errors from the debug layer that it hangs the computer as well
 
@Pubby: First thing that comes into my mind:
 
heh
 
user142019
Clang already seems to allow multi-non-null-statement-statement lambdas without explicit return types.
 
user142019
As a language extension.
 
12:16 PM
Now all C++ needs to do is replace auto by the keywords function and var and we have us a decent language going. var x = 1;function foo() -> int { return 42; }Konrad Rudolph 7 secs ago
 
#define function auto
#define var auto
 
user142019
A CXCursor_FunctionDecl includes the function definition. T_T
 
user142019
FUCK CLANG. Piece of junk.
 
user142019
How the fuck am I supposed to get the declaration out of it without parsing it myself. I could just as well write my own C++ implementation.
 
IME Clang is definitely an annoying piece of junk
@Zoidberg'-- A conclusion I've been coming to recently as well
 
12:31 PM
4
A: why vector push_back<shared_ptr<T>> not work in a for loop for my defined class

Matfor(i = 0; i < 20; i++); // ^ this little guy is killing you Remove that ;, you've got a for loop with an empty body.

It's always the small things that get you :)
 
user142019
Is it possible to have a { token anywhere in a function signature?
 
void foo(decltype(Bar{}));
 
user142019
FUCK. :P
 
user142019
This C API is so incomplete.
 
@Pubby #define function auto will replace std::function with std::auto... probably not the best idea ever :)
 
12:33 PM
lol
 
user142019
@DeadMG are you using clang's C++ API?
 
@Zoidberg'-- Yeah.
 
user142019
I'll try that instead. I'm getting sick of this C API.
 
@Zoidberg'-- Why is the curly brace in a signature so important to you?
 
really... I wouldn't bother
unless you're very desperate
 
12:34 PM
@Zoidberg'-- int foo(std::array<int, 3> = {{ 1,2,3 }})
Does that count?
 
user142019
@FredOverflow if I ask clang for a function declaration, it gives me the declaration plus the definition. I don't want the definition so I thought I could just read the tokens until the first { token.
 
int foo(decltype({1,2,3}) x) // dunno if this will compile
 
@Zoidberg'-- If I ask Clang for a function declaration, it tells me it doesn't exist, even though I know it does.
 
user142019
lol
 
0
Q: Can't find identifier through Clang API but Clang can find it when used

DeadMGI'm looking up an identifier in a C++ source file parsed by Clang. It's a function that takes five arguments which is declared right there in the source file (not a header). When I attempt to call it with one argument, Clang gives an appropriate error- even the full text of the declaration of the...

 
user142019
12:37 PM
Wait, I could count parentheses.
 
@DeadMG -1 for link dumping (just kidding!)
 
@Zoidberg'-- Trailing return type.
 
user142019
arrrg xD
 
He could count parenthesis there as well.
 
right
 
12:37 PM
If all open parens are closed and a curly is coming, it must be the body, right?
 
user142019
I want the function's AST node.
 
right, but that's still parsing the function declaration
 
user142019
But the C API doesn't expose AST nodes.
 
user142019
In the past clang could output the AST in XML format.
 
Xeo
@StackedCrooked What was that a reply to? :)
 
user142019
12:41 PM
Oh how wonderful. Now clang's website is also down so I can't read the documentation.
 
Xeo
I bet you're all just using it the wrong way.
 
of course we are
the question is how easy it is to find the right way
and with Clang, you may as well be sticking your hand in a wall full of syringes trying to find the one that doesn't have AIDs-infected blood in it by virtue of measuring your viral load after you've stuck your hand on all of them
 
user142019
Do you use clang::ParseAST?
 
no
my code's in the question
but there are only a very few Clang APIs which expose LLVM types and none of them appear to operate in a useful fashion
 
user142019
meh
 
12:45 PM
think I will have to start looking at the private APIs
 
user142019
I think you should use ASTConsumer.
 
user142019
Fuck this shit. I'll write my own parser.
 
user142019
I don't need function definitions anyway.
 
user142019
I only need declarations.
 
Sounds like you guys suck.
Howdy.
 
12:55 PM
hi
no, Clang sucks
primarily because it has both extremely questionable semantics, like owning raw pointers, and no documentation to document those semantics
 
user142019
I'll just count the parentheses. gist.github.com/4358794
 
user142019
Oh yeah of course the parser sees >> as one token in a template.
 
user142019
Very handy, clang. Thank you very much. You are so useful.
 
user142019
And what's with this function declaration that has no tokens at all.
 
user142019
Oh and it doesn't even parse the file I give it, only the files that file includes.
 
user142019
1:04 PM
Also, my paren counter doesn't work with decltype(something) in the return type.
 
You are writing your own parser?
 
@Zoidberg'-- Why not?
 
@R.MartinhoFernandes Clang won't give him the information he needs.
 
user142019
@FredOverflow typename std::enable_if<stuff<decltype(muh)>::value>::type void moo();
 
user142019
After muh, the paren count becomes 0 and whoops.
 
1:07 PM
You should parse until the first { with a paren count of zero.
 
user142019
Hmm.
 
user142019
Of course.
 
huh
clang rejects extern "C" { decl(); }?
must have accidentally not mentioned that it was C++
 
Missing return type?
 
@Zoidberg'-- Does your parser handle <% and ??< correctly? ;)
 
user142019
1:09 PM
@FredOverflow Also ;.
 
@R.MartinhoFernandes No.
 
@Zoidberg'-- Right, if it's just a declaration.
 
user142019
@FredOverflow I'm not really going to give a damn about digraphs and trigraphs now. :P
 
was just that I did not tell Clang that it was a C++ file
 
user142019
It works! Woohoo!
 
1:10 PM
Merry Christmas :)
 
but Clang will still insist that I did not declare this thing
 
user142019
I forgot to add the -std=c++11 flag to my program so it didn't parse the variadic template. xD
 
When will -std=c++11 be the default?
 
user142019
Probably never. That would break compatibility with ancient projects that use Makefiles.
 
user142019
I now get this output from my program. :^) gist.github.com/4358855
 
1:12 PM
well
if you wanted a giant list of function declarations, then gz
 
user142019
I still want to filter on the file they are in, but that's easy.
 
Clang still insists that the name does not exist
most irritating
 
user142019
Function templates are now also included. :^)
 
user142019
And classes, structs and unions, including complete and partial specializations.
 
29
Q: How does this piece of obfuscated Haskell code work?

AlexandrosWhile reading http://uncyclopedia.wikia.com/wiki/Haskell (and ignoring all the "offensive" stuff), I stumbled upon the following piece of obfuscated code: fix$(<$>)<$>(:)<*>((<$>((:[{- thor's mother -}])<$>))(=<<)<$>(*)<$>(*2))$1 When I run that ...

lol thor's mother :)
 
1:23 PM
hi all
 
@lara We don't know anything about WAV files, just in case.
 
user142019
lol
 
user142019
What the fuck.
 
@Zoidberg'-- What did you write your parser with?
 
user142019
How can I ask clang in what file a CXCursor is. T_T
 
user142019
1:24 PM
@FredOverflow libclang
 
@FredOverflow dont worry...i even dont know WAV file..;)
 
@Zoidberg'-- ask IDE
 
bitchslapped
 
user142019
@Abyx What? I don't want to have my program invoke an IDE.
 
user142019
I'm using libclang to get a list of declarations from a source file.
 
1:26 PM
@lara Just download Visual Studio 2012 Express.
 
user142019
I currently have this and it seems to work. The code is terribru. though. gist.github.com/4358893
 
user142019
And it segfaults when you give it a non-existing file, as you'd expect from clang.
2
 
user142019
Let's see if I can have it output HTML.
 
user142019
1:43 PM
Woohoo syntax highlighting.
 
> Did anyone ever test this new syntax on a German keyboard? It's painfully inconvenient to use curly braces, much more than the old parantheses. However the new lambda syntax take the cake! Entering [](){} is pure torture... I'm not joking. As much as I love the semantics of both these features, they couldn't be possibly harder to type on a German keyboard as they are. It's almost impossible to enter any of those without at least one typo!
 
user142019
Hmm this is tricky.
 
user142019
I also need to ignore : and = default, but not = delete.
 
@FredOverflow Meh, just use an English layout.
 
2:04 PM
@R.MartinhoFernandes obviously
@FredOverflow Anyways, the new generic lambda proposal PoC implementation should take the real biscuit! See isocpp.org/blog/2012/12/…:
auto NumElements = []<int N>(auto (&a)[N]) { return N; };
 
2:21 PM
Ah. This is a common condition here:
Witzelsucht (from the German witzeln, meaning to joke or wisecrack, and sucht, meaning addiction or yearning) is a set of rare neurological symptoms characterized by a tendency to make puns, tell inappropriate jokes or pointless stories in socially inappropriate situations. Ironically, however, the person is insensitive to humor produced by themselves or others around them. A less common symptom is hypersexuality, the tendency to make sexual comments at inappropriate times or situations. Patients do not understand that their behavior is unnatural, therefore are nonresponsive to others' rea...
Dec 12 at 22:57, by sehe
BREAKING: TIL I might have dysania, but very likely not hippopotomonstrosesquippedaliophobia
Added to the list :)
 
user142019
@sehe Hurray the list is complete []<>(){}.
7
 
“Haskell is compiled from .hs-files which means HOMO SEXUAL”
 
user142019
@BartekBanachewicz C++ is compiled from .cpp-files which means CHILD PORN PORN
 
user142019
What shall I write in C++ today.
 
@Zoidberg'-- achievement unlocked :-)
 
Ell
2:34 PM
ughh my laptop is now rather slow
 
user142019
Overclock it.
 
Ell
I doubt I can :P
 
user142019
You can do that in like 99.9999999999999% of all BIOSes.
 
Ell
really? o.O
 
user142019
Uh yes.
 
Ell
2:37 PM
I thought you couldn't with most motherboards
anyway this has already had a power distribution failure
so maybe it's not a good idea
 
user142019
It's not a good idea anyway.
 
user142019
Especially on laptops.
 
user142019
Unless you have nitrogen or helium cooling. :P
 
user142019
I'm pwning the star board.
 
> we spend twenty years thinking abou tit.
lol, freudian slip there @DeadMG
Oh wait, didn't notice the missing t in about.
 
2:41 PM
lol
 
@BartekBanachewicz Equal chance of it meaning hetero-sexual
 
lol, freudian slip there @Pubby
 
Ell
anyone had any experience with java code injection?
 
@Zoidberg'-- tranlslsation: you talk too much
@Ell is that lethal?
 
Ell
@sehe haha almost always ;)
 
2:50 PM
I though java didn't have UB
 
user142019
Tomorrow I will be eighteen.
 
@sehe It doesn't, unless you muck with JNI.
 
@Zoidberg'-- sad story. Now you will be legal
 
user142019
Legal?
 
Ell
@Zoidberg'-- congrats
 
2:51 PM
I dunno. For some things. In some jurisdictions. Mebbe
 
Ell
will you go into a mating frenzy then die?
 
user142019
Oh. lol
 
@Ell cough. premature. The world might still end
 
user142019
@Ell no.
 
Ell
@Zoidberg'-- but you will try to fight fry to the death?
 
2:52 PM
I lubed my rubik's cube. Now really smooth
 
user142019
@Ell Fry? That's my crappy C++ library.
 
Ell
futurama fry:3
 
I only learned how to sdolve it last week, since the kids got one from me Santa
 
@Ell Ah, the meaning of life
 
Ell
ughh I'm trying to write an injection client for puzzle pirates, it's a lost cause xD
 
2:53 PM
@sehe It will slide right in now
 
user142019
@Ell heh I put that as the logo on Bitbucket.
 
Ell
@Pubby ...nice :L
 
I feel dirty for making that joke :(
 
Ell
haha
41,878 errors... gawd this is not happening
 
user142019
lol
 
Ell
2:55 PM
how did the minecraft people do this? >.<
 
do what?
 
user142019
I had over 70k compile-time errors once since I compiled Objective-C code as C++ by accident.
 
@Pubby you should. also, what joke
 
user142019
I always set the error limit to infinity.
 
Ell
@Pubby unobfuscate decoompiled java
 
2:56 PM
@sehe secret joke
 
user142019
Your joke is secret and you should feel secret.
 
@Pubby is a joke when you say something with a twist? You know, something unexpected that sounds familiar enough to take people by surprise
 
@Ell Dunno why minecraft isn't open source already. Probably because they like money.
 
No shit
 
Ell
@Pubby they've already made a tonne of money off it
 
2:57 PM
afk. Groceries
 
user142019
Notch said he would make Minecraft OSS when it doesn't make any money anymore.
 
I mean once you become a billionaire it seems like money would stop being meaningful
Just give it away and start collecting praise for your charity rather than money
 
user142019
 
^krabs is better than zoidberg
 
user142019
No, Krabs is inferior to Zoidberg.
 
user142019
3:01 PM
I'm not discriminating; everyone is equally inferior to me.
 
user142019
3:15 PM
lol
 
user142019
if (...) try {
    ...
} catch (...) {
    ...
} else {
    ...
}
 
user142019
if (...) {
    ...
} else while (...) {
    ...
}
 
Ew
 
-6
Q: What does %d mean? Why d and not another letter?

Abdul MontaqimI'm just starting out learning C and wanted to ask some very elementary questions. I don't have any programming background at all. I'm just at the very start of a tutorial (http://www.cprogramming.com/tutorial/c-tutorial.html) and there's some things it doesn't explain. Like, for example, in this...

 
user142019
@Zeta Because ask Stack Exchange.
 
3:21 PM
^ why isn't there a "oh, my god, please burn this question" close option?
 
@Zeta That question was originally tagged . Made me laugh.
 
user142019
3:35 PM
52
Q: Examples of "modern c++" in action?

joeldFor new and completely revised tricks and dark corners of STL go here: Hidden Features and Dark Corners of STL I've been using more "modern" c++ constructs for a while, but kind of superficially and not everywhere. I'm looking for open source projects to study that are good examples of Modern C+...

 
user142019
> Google's C++ coding guidelines are a good scaffold for large project.
 
user142019
Oh God...
 
hello, could anyone here help me fix a problem with my vector?
 
user142019
@Dean What kind of vector?
 
I have s vector<Entity>, I keep getting an exception "Expression vector iterator not dereferenceable"
 
user142019
3:40 PM
What is your code? Paste it here.
 
double distanceSquare(const Entity & p, const Location & location) {
double delta_x = p.X - location.X;
double delta_y = p.Y - location.Y;
return (delta_x * delta_x + delta_y * delta_y);
}

Entity & GetNearestEntity()
{
return *std::min_element(fb.Entities.begin(), fb.Entities.end(),
[](const Entity & a, const Entity & b) {
return distanceSquare(a, fb.PlayerLocation) <
distanceSquare(b, fb.PlayerLocation);
}
);
}
 
I am still not used to darkness at 16.
 
i used my 6 daily limit already lol
 
Thank god Monday I will go back to some place with sane daylight hours.
 
3:41 PM
@R.MartinhoFernandes I still feel odd going to work in complete darkness. Merry solstice!
 
@Dean Are you sure the vector has elements?
 
Yeah it should have elements
 
@R.MartinhoFernandes At what latitude/parallell are you?
 
actually, it may not have elements, maybe that's why
 
@Dean Should is at #2 on the list of famous last words.
 
user142019
3:43 PM
Use a debugger.
 
@CaptainGiraffe Berlin. Don't know the parallel.
 
im programming from in process so i can't debug it
 
user142019
You are doing what?!
 
@Dean That is definitely why.
 
user142019
3:44 PM
> im programming from in process
 
I'm writing a dll and inject it into process so i don't know how i can debug it this way
 
@R.MartinhoFernandes Berlin! You lucky bastard. And you are complaining about daylight? I have 2.5 hours of daylight here in Sundsvall Sweden. :/
 
Since you all think Clang sucks, why not use GCC instead. I'm sure that now they half-heartedly switched to C++, the situation has much improved :P
 
user142019
@Dean Well, debug the process you inject it into.
 
@CaptainGiraffe Hehe. I lived at 41º N for 25 years.
 
3:46 PM
that's a good idea
 
user142019
$ gdb myprocess
(gdb) run
 
user142019
It ain't rocket science.
 
user142019
Or you know
 
thought i don't know how, I'm new to this
 
user142019
just std::cout << fb.Entities.size() << '\n';
 
3:46 PM
@Dean If you are using Visual Studio, go to Debug > Attach to Process... and select your target process.
 
ill give that a try, thanks guys
 
I do that all the time at work.
 
@R.MartinhoFernandes That translates to mid/north spain. I can see why you object to the darkness.
 
user142019
Is there ever a reason to have a non-virtual destructor in a class that has virtual member functions?
 
Don't think so.
Well, in some situations you can avoid it, but they are rare and require extra care.
 
3:49 PM
@Zoidberg'-- I would be surprised to find a situation like that. P=NP kind of surprise.
 
I don't think avoiding it should be a goal.
 
user142019
In that case I'll enable -Wnon-virtual-dtor at all times.
 
@Zoidberg'-- you mean -Wnon-virtual-dtor
 
@R.MartinhoFernandes For private inheritance ?
 
I think that one is in the -Weffc++ package.
@JohanLundberg Private inheritance with virtual functions involved?
That sounds weird.
 
user142019
3:51 PM
lol protected inheritance
 
Virtual functions are about providing one interface and multiple implementations, but private inheritance effectively takes away the interface.
 
@R.MartinhoFernandes effectively = FAPP
 
@R.MartinhoFernandes I have a case like that in code I work with. There's a baseclass with a virtual function that is called at timeouts. That private baseclass is purely an implementtion detail
 
I don't want to google "FAPP".
 
user142019
3:52 PM
@CaptainGiraffe Virtual function masturbation?
 
For All Practical Purposes
 
sry =) I thought that was well known.
 
@JohanLundberg With friends?
 
3:53 PM
Then how do you use the private base?
 
@JohanLundberg There is no practical reason for having a private base class, as opposed to a private member, other than the syntax.
 
the function is not called from derived, only implemented, no access problems.
@CaptainGiraffe sure.. syntax
 
@CaptainGiraffe EBCO.
 
@CaptainGiraffe Actually, with c++ pre 11 it's an easy way to set up a callback, but you can have only one...
 
@JohanLundberg But where is it called from?
 
3:56 PM
@JohanLundberg Its not apparent to me how, care to give a simple example?
 
OK, longer version:
 
@R.MartinhoFernandes Is EBCO about zero size base classes? Not sure how that would work.
 
Yeah.
It's how unique_ptr can store stateless deleters without overhead.
 
oehra
 
@R.MartinhoFernandes Ah, yes of course. Thanks.
 
3:59 PM
Say I have a class called CallAtMidnight with only protected methods, and private data. Every midnight it calls its own pure virtual function virtual void doAtMidnight(), which is private.
Then, to do something at midnight, you only have to privately inherit from doAtMidnight and implement doAtMidnight(). No need for a virtual destructor
 
Ambrosia is running external commands on Linux.
and probably equally well on Mac.
 

« first day (798 days earlier)      last day (4149 days later) »