« first day (396 days earlier)      last day (4554 days later) » 

2:00 PM
@KerrekSB do you want me to post all the gory intestines it spat out? :(
 
@RMartinhoFernandes No! Only whether a) it does compile with g++, and b) whether it fails with g++ -std=c++11.
(Also I'm curious what happens with -DUSESTD.)
 
Fails with -std=c++0x.
c:/libs/boost_1_47_0/boost/regex/v4/basic_regex.hpp:164:58: error: use of deleted function 'boost::shared_ptr<boost::regex_traits_wrapper<boost::regex_traits<char> > >::shared_ptr(const boost::shared_ptr<boost::regex_traits_wrapper<boost::regex_traits<char> > >&)'
 
Yeah, exactly
 
sbi
@cpx It would be easier if you just remembered to always immediately initialize any variable you define. Supplement that with "I use parentheses whenever the precedence is esoteric", and you'll get pretty far without fully remembering the precedence of all operators.
 
Without -std=c++0x fails during linking.
 
2:01 PM
Imagine my ire. Also, when you build Boost, you have to run one entire compiler run for each compiler version, so the complexity soon exploded,
 
Duh, I need to add -lboost_regex. Brb.
 
You need -lboost_regex or -lboost_regex-mt.
 
Cool, thanks.
Oh, dammit, I don't have boost_regex built :( I can only tell you that it reaches the linking phase.
 
nothing makes me happier than chomping on DRYolations
 
@RMartinhoFernandes Yeah, that's fine. The compiler error is slightly more pressing.
 
2:06 PM
And with -DUSESTD... regex.cpp:17:62: error: 'std::regex_constants' has not been declared
 
Alright, thanks! Do you have an SVN repository that you keep updating?
 
@RMartinhoFernandes Oh crap. You can kill that std::cout line...
the STD support is really rather lacking.
 
@KerrekSB Not on Windows. I download pre-built MinGW binaries.
 
Oh OK
I installed 4.7 when that guy asked about the user-defined literals, and for a moment I felt victory, but now I'm burned. I'll stick to release versions from now on!
 
2:08 PM
:)
Well, having done _s I'm now working on _b.
 
I wish that VS would support variadic templates
 
lol
That's not even on VS11 is it?
 
@RMartinhoFernandes Try the template version of the user-defined literals!
 
no, they hardly added any new C++11 features
 
Very satisfying.
 
2:10 PM
@DeadMG But the , operator lets me feel like I'm doing functional programming because all of my expressions have values! It's (progn for C++!
 
@Omnifarious sorry about that snapshot thing! It was meant for @Pubby!
Oops.
 
@RMartinhoFernandes No problem. :-)
I think that's my new programming style. Only use braces for loops or type names. Do everything else with ?: and the , operator.
 
all expressions have values anyway
except those which return void, which are few and far between
 
And really, who needs loops when you have for_each and lambda expressions?
 
Ugh, for_each.
Real functional programmers use folds.
Or bananas.
(Folds are a specialized kind of banana anyway)
 
2:14 PM
Now I want to know what folds are.
 
@DeadMG Maybe all expressions have values, but do they have value? :-)
 
lol
 
2 days ago, by R. Martinho Fernandes
Woo, foldl: http://www.ideone.com/H4iYh.
 
1>parser.cpp(61): fatal error C1001: An internal error has occurred in the compiler.
 
guys, what's the best way to have threading in Visual C++ 2008 ?
 
2:18 PM
buy Visual C++ 2010 and use their Parallel Patterns Library
 
failing that, grab Intel's Thread Building Blocks (TBB)
 
@RMartinhoFernandes Thanks! I also looked it up on Wikipedia.
 
@DeadMG Can't you use the Express version?
 
not if you want to produce a commercial product
 
2:18 PM
Are you certain?
 
I assumed that if he wasn't, he would have upgraded anyway, since there's no reason to stay on an older compiler
VS might not have introduced significant new features in 11, but rvalue refs are a big deal imo and well worth the upgrade
 
This question on Unicode literals has gotten a bit worn out. I said that \uXXXX is a source-code literal escape sequence that gets processed very early in the compilation stage, but everyone keeps saying that "yes, but in ICU "\uXXXX" means something else. I'm sure we all mean the right thing, but it's just not a very pretty state of affairs just now.
 
Well, turns out you can produce commercial products with the Express version.
 
No hope for Visual C++ 2008 Express Edition users? :(
 
get TBB
you could get boost::thread or something instead, I guess
but if you didn't pay for VS, then just upgrade and use the PPL
it's not like you have to pay to uprade from VS 2008 to VS 2010 for Express edition
 
2:21 PM
is it free?
 
im a student working on my Final year project :)
 
yes
 
as I posted at stackoverflow.com/questions/8152771/… I need to do multiple marker detection + openGL stuff for each marker.
will TBB save me from all the confusions in Threading like Mutexes?
rather synchronization issue
so need a simple, straightforward approach
 
maybe
 
2:24 PM
I think both the PPL and TBB are intent on providing high-level constructs.
 
there's no such thing as a simple, straightforward approach to threading
TBB can simplify certain constructs, like parallel access to a container
but fundamentally, you have to design your program for concurrent use
 
I once tried with windows' CreateThread() it was confusing :S
 
and if you don't understand concurrency, you can't just throw a couple concurrent-access containers at the problem
oh, yeah, that's half because it's the Windows API
 
I did concurrency in Java.
 
TBB is much higher than that
 
2:25 PM
it was fun though
 
concurrent_vector, parallel_for_each, etc
 
@DeadMG Well, but it is easier to use concurrent containers than synchronization primitives directly :P
 
oh yes
but it can't magic concurrency
you can't just spray on some TBB and problem solved
 
Spray some Ubik!
 
especially as it cannot solve the concurrency problems of external libraries
only All Purpose Spray can fix external libraries
 
2:27 PM
Right, that's Ubik!
 
lol
 
with CreateThread, I had a issue with an OpenCV function. I think it was due to bad synchronization.
 
fuck you and your ICEs, VS
 
ICE?
:S
i think it wasnt meant to me? :)
 
@coder9 Internal Compiler Error.
 
2:28 PM
@coder9 internal compiler error
 
lol
 
that reminds me, still no response to the one I filed on Connect
which at least means it hasn't been closed as WONTFIX yet
@DeadMG is it reproducible?
 
> With the new Ubik concurrent components library concurrency is easy and safe. Try Ubik. Warning: Use only as directed. Avoid prolonged use.
 
@jalf better still - is it exploitable?
 
sbi
2:32 PM
@awoodland Wow, and I've been called evil here yesterday...
 
Also, they're making a Ubik movie. I'm not sure if I should be happy or angry.
 
sbi
@DeadMG Not even the thing which, when uttered, will invoke our Lion in Residence™??
 
no idea
@sbi Ask me when I find a woman
 
sbi
@DeadMG What do you mean? Uh, how do I ask that... How old are you? :)
 
that was @jalf
my bad
 
sbi
2:38 PM
@DeadMG Er, @jalf is, TTBOMK, not a woman.
 
pity
 
@RMartinhoFernandes Oh, that's a generic implementation of the sum function I was looking at implementing the other day. Though, because you have to provide a particular function to it, it's not so easy to make one that will sum a set of varied types with the result being the correct type.
 
I am, however, confused. Does that count for anything?
 
here was me getting mah hopes up
@jalf it's just sbi, ignore him :D
 
@Omnifarious Yeah, lambdas are monomorphic. You have to write a full-fledged function object with a templated operator() to sum varied types :(
 
2:42 PM
is there any thing called Template Template Template Parameter in C++ or possible even ? ( completely theoretical question)
 
Is that a serious question?
 
sbi
@jalf It all boils down to @Dead not referring to your message when he replied to it, which made the resulting chat transcript, uh, interpretable.
 
I believe that the nesting is arbitrary
 
@RMartinhoFernandes no it's theoretical
 
sbi
@user411102 I don't think so, but there are template template parameters.
 
2:43 PM
@sbi You mean "uninterpretable", right?
 
sbi
@RMartinhoFernandes No, actually not. I was trying to convey that the result could be interpreted, rather than being clear right away.
 
@RMartinhoFernandes Well, I ran it through a JavaScript interpreter and it came back with an error, so I guess that is an accurate description
 
@DeadMG whatever nesting you do , maximum you'll end up with Template Template Parameter
 
Yes, because there are no template templates.
 
@RMartinhoFernandes actually , i was asking this question because i was having a argue with a friend
 
2:45 PM
your momma's so fat, when I tried to template her, all major compilers gave an internal compiler error
so in other words, not very fat at all
 
omg i will kill myself!!!
 
@sbi @RMartinhoFernandes Thanks for help :)
 
@user411102 You can certainly build a sentence that contains the word "template" four times in a row...
 
sbi
@user245823 Please, not in here. We don't want to draw the attention of the meta police.
 
2:48 PM
i was having issues with dll not statically linking and made all the changes...
 
sbi
@KerrekSB Malkovich?
 
the exe was finding the exported functions but would not
 
@KerrekSB :D
 
sbi
@user245823: What are you talking about?
 
exe the static function in the wrapper...turns out i was not updating my dll that the exe was using so it just
 
2:49 PM
@sbi my suggestion was academic evil though in that I'm not aware of any exploits targeting compilers
 
caused me a lot of pain!!
 
Academic evil.
That's new.
 
in the same way that people like to publish new attack vectors
 
sbi
@awoodland Oh, wasn't there that famous paper by... who was it?
 
2:52 PM
nah it was just an issue was dealing with
i just can't believe i was that stupid
btw
 
sbi
@RMartinhoFernandes Yeah. You were faster. As usual.
 
i wanted to say thank you to everyone here
for all the help and support
regardless it was really good to have a forum like this
i think i would go crazy if not for stackoverflow!
 
@sbi Cool. Nice to hear I'm getting my street cred back.
 
sbi
@user245823 I'm not sure I have done anything besides failing to understand your rumblings here, bit if that everything you needed to solve your problem, then that's fine with me.
@user245823 You know, I, OTOH, secretly suspect that I would be much saner if it wasn't for this chat here. But that could just be me...
 
hahahh
 
sbi
2:58 PM
@RMartinhoFernandes Yeah, if you work for your credit, you'll certainly get it. We're rather fair here, or so I'd like to think.
 
@sbi I spend more time on this chat in a day then I do on facebook in a year
 
Today's word of the day is opuscule: a "small or minor work."
 
I thought it was "Wednesday".
 
@user245823 Glad you got the issue sorted out!
 
3:05 PM
@vivek Linux rules!! :)
 
sbi
@vivek I have actually logged out of FB and deleted all of its cookies I could find.
 
@sbi How would that benefit you ?
 
ugh, it's surprisingly annoying how the MSVC IDE treats array and where and others as keywords
 
@TonyTheLion yes !
but sadly I can't install anything other than windows on my hard disk
 
@jalf That's C++/CLI.
 
sbi
3:08 PM
Did you know started Jan 1, 1970? That's a great answer, BTW.
 
No, the IDE does it regardless of whether CLI extensions are enabled or not
the compiler doesn't, of course
but the IDE wil highlight them, and if they're variable names, the debugger won't show their values because "huh, that's a keyword"
 
@sbi I think you missed a noun.
 
I think Xcode does the same thing with result.
 
@jalf That's incredibly silly. And not surprising, given from where it comes.
 
Yeah, yeah. Micro$oft™® is evil and all that.
 
3:11 PM
@Maxpm No, that's not what I'm saying.
 
@RMartinhoFernandes What are you saying?
 
That's not surprising Microsoft did a silly thing in their IDE.
 
x64 - Kernel Privilege Escalation, for those feeling very adventurous!
 
sbi
@RMartinhoFernandes Damn. Time.
 
Ugh, Eclipse is terrible.
 
3:14 PM
template<typename _II, typename _OI>
inline _OI
move(_II __first, _II __last, _OI __result)
WTF is this doing in the GCC standard library?
Oh nevermind, it's not public.
Wait, it is.
 
I don't get it.
(Bear with me. I'm "slow.")
 
The Better Approach To Mobile Adhoc Networking, or B.A.T.M.A.N., is a routing protocol which is currently under development by the “Freifunk”-Community and intended to replace OLSR. B.A.T.M.A.N.'s crucial point is the decentralization of the knowledge about the best route through the network - no single node has all the data. Using this technique, the need for spreading information concerning network changes to every node in the network becomes superfluous. The individual node only saves information about the “direction” it received data from and sends its data accordingly. Hereby the da...
LOL
 
@Maxpm AFAIK, there's only one std::move and that has only one argument.
Now this crap is screwing with my code.
 
Screwing with your code? How?
 
Well, at least it's spamming my error messages in the overload candidate lists.
 
3:19 PM
Oh.
 
@RMartinhoFernandes What's the problem? It's the union of move_iterator and copy...
 
@KerrekSB Oh, it's standard?
 
@RMartinhoFernandes I'm pretty sure it is.
 
I think I read about it it Scott Meyers's C++11 ebook.
(I knew about move_iterator before. But this seems like the logical thing to have.)
 
3:21 PM
Haven't read all of that yet.
 
25.3.2 in the standard.
 
@KerrekSB Yes, it's there.
Anyway, I'm pissed off, either at GCC for breaking my code, or at myself for leaving broken code around for 3 weeks. I'm still investigating who's responsible.
Now I'm totally lost.
 
@RMartinhoFernandes In Soviet Russia, code breaks you.
 
Hmm, unordered_map has these two:
pair<iterator, bool> insert(const value_type& obj);
template <class P> pair<iterator, bool> insert(P&& obj);
If I do map.insert(value_type()), which one should it pick?
Will it ignore that it is an rvalue and prefer the non-templated version?
 
I would have said the non-template one
 
3:33 PM
That sucks.
Because value_type needs to be copyable for that.
 
@RMartinhoFernandes there might be some "excluded from overload resolution if not copyable" wording on that specific insert in the standard though
 
c++0x sounds like crap
 
could've been c++x
 
3:43 PM
It's actually C++11.
 
or c++++
 
Damn, GCC broke my SHA1.
 
:P
 
@KerrekSB I'm starting to regret this. But UDLs are so cool!
 
@KerrekSB ahahahahahhahahaha, здр :D
In Soviet Russia, code compiles you.
 
3:48 PM
@RMartinhoFernandes As a work-around, you can say m.insert(std::make_pair(TheMap::key_type(...), TheMap::mapped_type(...))), and it'll work. All hail the new std::make_pair...
@Tenev Very much so!
 
@KerrekSB Yes, that's what I did.
 
I'm throwing out some bounty...
 
Can you see anything wrong with this exception? ideone.com/bmgSd I mean, it looks very simple, but I like to get peer confirmation before blaming the compiler :9
 
@KerrekSB what are you looking for? I might bite on this, but I thought the answer with 18 votes covered it.
 
@RMartinhoFernandes Do you have to define all the Obvious Functions manually?
@awoodland It's only one single example, and a contrived one at that.
Is that the only thing this construction is good for?
I say "contrived" because I struggle to think of real code in which you would have two pointers whose type you don't know at all. If the two pointers already have some specific base type, you can just cast to that type and compare.
Unless the void-cast is preferable for some reason (maybe performance?)
 
4:03 PM
@KerrekSB No, just being explicit. Could it hurt? When I throw it, something bad happens. It appears I can't catch it.
 
@RMartinhoFernandes Generally, the less you write the better... do you mean those exception specifications are useful?
 
try {
    throw corrupted_hash();
} catch(corrupted_hash&) {}
 
@KerrekSB - I think I might be able to show a case where that example is useful/needed then, but it's effectively just a use case for that example
 
Even this code blows up without any decent information.
 
@awoodland The only advantage of spelling anything out that I can see is that you have those noexcepts, which might make a difference, but probably won't.
struct corrupted_hash : public std::runtime_error {
    corrupted_hash() : std::runtime_error("hash object corrupted") {}
};
That just looks a might cleaner to me...
 
4:09 PM
@KerrekSB Nope. Same result :(
 
@RMartinhoFernandes What do you mean? Is there an actual problem somewhere?
 
@KerrekSB A program with just the try-catch above in main() gives me the Windows crash dialog.
 
Catch it by const-reference.
 
Tried it. Same thing.
It's got to be the compiler :(
 
lol
 
4:14 PM
Works perfectly for me.
Even by non-const reference
 
I think I can live without hashing stuff longer than 2^64 bits, but this fails even with std::runtime_error. Dammit.
 
Poor workman blames his hash...
:-)
If there's a problem with MSVC, you should file a bug report.
 
It's GCC 4.7.
 
But maybe post a minimal example first on SO to see if it's common.
I think you already know my opinion on that one.
 
@KerrekSB In Soviet Russia, you don't file bug report, bug report files you :D
 
4:16 PM
@KerrekSB Right. I'm starting to understand it :(
 
It truly is "not fit for production".
@Tenev More like, "bug reports on you"!
Ohhhh
 
maybe
but really, MSVC has too many bugs
 
@Tenev At least you can throw exceptions.
 
(What just happened: I never said "Ohhhh" -- I just got a "retry/cancel" on this message that wasn't mine??)
 
not talking about the code
 
4:17 PM
@KerrekSB What?
That's weird.
 
@RMartinhoFernandes how do u throw exception on the IDE itself :P
 
Unless it's something truly ancient I typed a few days ago... I don't quit my browser. Very suspicious.
Why don't we have SSL?
 
@KerrekSB because in Soviet Russia you we don't need SSL!
лол
 
in Soviet Russia tired gets old joke?
 
however, i find it hard to believe that when my program compiled with MSVC (a professional compiler by microsoft) is 20% slower than my program compiled with Code::Blocks or DevC++
is it that GCC is a masterpiece
 
4:27 PM
gcc isn't exactly an amateur play thing
and being opensource people can/do use it for research directly
 
Dev-C++ is an awful piece of crap, and is not a compiler.
Also GCC and MSVC tend to generate roughly equivalent code in terms of speed, save for LTO, which is still pretty new in GCC.
 
Dev-C++ was good... ages ago.
 
Dev-C++ was never good.
 
I still wonder how it's so much used, though.
I mean, if you're looking for a free C++ IDE, Code::Blocks is way better.
 
Xeo
hey guys
 
4:36 PM
People don't know any better, which is why telling everyone it's a piece of crap is important.
 
It's our duty to educate.
 
assert(101010_b == 42); Yay, progress.
 
Binary literals again?
 
can you not static_assert that with constexpr too?
 
4:39 PM
Not again, it's the first time I can actually write them.
@awoodland Yes you can.
 
They came up some time ago.
I still think they're nigh useless.
 
@CatPlusPlus But cool!
Cool trumps useful.
 
next obfuscated C++ contest is going to be fun...
 
@awoodland Yeah, now you don't have to use templates.
 
mawning
 
4:42 PM
@EtiennedeMartel and if you do use templates there are oh so many ways of making it hard to guess which one is used
 
@awoodland Templates should be banned from the obfuscated C++ contest because they're overpowered.
 
haha
nerf templates!
the Obfuscated C++ Contests could be won easily- just look at the MSVC STL internals
 
@DeadMG wouldn't that be Java then? :)
 
lol
 
At least C++ has function objects.
That's my main gripe when I have to go back to Java after doing C#: where the fuck are my delegates? Why do I have to write twice as much code to do the same thing?
 
4:45 PM
RARGH INTERNAL COMPILER ERROR
:(
 
@EtiennedeMartel Because.
 
If anyone wants some bounty and has a good idea for a post on this question about exceptions and destructors in PHP, I'd be happy to start another round. I'd be especially thrilled if there were a proof that the PHP object system implies that the loose unwinding order is OK.
I just want the question resolved... not good to have white spots in the list :-)
 
@KerrekSB PHP? Ergh, I'm not touching that. Brings back too many bad memories.
 
@EtiennedeMartel Understandably. But your therapist said that you have to confront those demons, and you cannot forever run away.
 
Xeo
I got a strange problem.. everytime I try to download a .exe, the download window pops up for a second, and then I get a "this link needs to be opened with an application" window, where I can choose between some apps or search for another one.
 
4:47 PM
Don't use destructors in PHP. Don't use destructors in any implementation with GC.
Also, we hate PHP.
 
also, RARGH PHP RARGH
 
Xeo
any ideas? :/
 
Yeah, it's only below Java in the "languages the C++ lounge loves to hate"
@DeadMG (╯°□°)╯︵ ┻━┻
 
user784668
@EtiennedeMartel You forgot C++.
 
Xeo
Table flippin'!
 
4:49 PM
@EtiennedeMartel Aren't you tired of seeing braces all over the place? The trendy PHP namespaces use the familiar directory syntax for namespaces.
 
@Fanael Yeah, but it comes in third place.
 
yeah, let's be fair, the Lounge<C++> is quite a fan of hating on C++ too
 
And for your own convenience, you don't even have to worry about nested namespaces.
 
I think every C++ programmer hates C++.
 
I'm getting this in VC++ : "error C2664: 'pthread_create' : cannot convert parameter 3 from 'void *(__cdecl *)(void)' to 'void *(__cdecl *)(void *)'"
 
4:50 PM
I don't
 
Xeo
@coder9 wrong argument type
 
@coder9 You passed a function that takes no arguments to a function which expects a function that takes a void*
 
user784668
@coder9 Your function should take a single void*.
 
I did PHP for nearly 6 years (I think. I can never remember exactly). I've learnt to write good code in PHP, if that's possible. I don't want to touch this language ever again.
 
@DeadMG Oh, come on, I'm sure, deep in your mind, you wished C++ was slightly less crappy.
 
user784668
4:50 PM
@CatPlusPlus "good code in PHP"? You gotta be kidding.
 
But you use it anyway because it's the only thing that does the job.
 
I hate some parts of C++ cough*headers*cough.
 
@CatPlusPlus Was it PHP4?
 
you mean
 
here's my code pastebin.com/bBxkxcqf :)
 
4:51 PM
4, then 5.
 
"I'm inventing a whole new language because C++ deepthroats donkey balls"?
 
I didn't realise PHP had exceptions and destructors :)
 
that kind of "deep in your mind"?
 
@awoodland I think neither did the PHP designers.
 
@DeadMG Oh, I forgot about that.
@CatPlusPlus Compilation model.
 
4:52 PM
PHP has exceptions, but don't really use them.
@EtiennedeMartel That's what I said.
 
@CatPlusPlus Yes.
 
the parser for which Visual Studio will not currently compile
 
I think most of C++'s crappiness can be traced back to its C heritage.
 
for no raison!
 
4:53 PM
@EtiennedeMartel that's also true of most of it's early success though isn't it?
 
user784668
@EtiennedeMartel I'd say it's quite the opposite, really.
 
@awoodland Yes, unfortunately. It's a double edged sword.
 
Xeo
Nobody got an idea for my download problem? :| I know, it's not C++ but.. maybe someone had the same problem?
 
@Fanael most of C's problems can be traced back to C++'s inception?
 
user784668
@awoodland yeah!
 
4:55 PM
Most of C problems can be traced back to C being unexpressive crap. Sort of like Java, but on lower level.
 
user784668
In fact, most of anything's problems can be traced back to C++'s inception.
 
World hunger, for instance.
 
Does a dynamic_cast always generate code, or is the compiler allowed to resolve it statically?
 
@KerrekSB static is fine - it's under the "observable behaviour rules" I think
 
0
Q: How does C# compare to Java and C/C++ speed-wise?

skypowerI know that C and C++ are slightly faster than Java, but how does C# compare to them? Also, is memory management a minus for Java vs C++ for large and heavy applications, like games?

Ooooh boy.
 
user784668
4:59 PM
It's 1.27% slower than C/C++.
 
user784668
Whatever C/C++ is.
 
closed before I could click vote
 
There is nothing in C++ that is guaranteed to generate code. In the worst case a compiler can emit a diagnostic consisting of not blinking the keyboard LEDs, and then proceed to generate an executable that does nasal daemon things. By the formal rules.
 
Xeo
same
 
Man, C/C++ must be one hell of a language. I keep seeing it everywhere.
 
Xeo
4:59 PM
very popular indeed
sadly, though
 

« first day (396 days earlier)      last day (4554 days later) »