« first day (708 days earlier)      last day (4466 days later) » 

00:00
At least not implicitly
Explicit conversion in this case is making a copy, so yeah.
They made it UB to enable string pooling, and anyone who says assigning a literal to char* is fine is an idiot.
And doesn't know C, but we already knew that.
The dangers of implicit conversion: std::string s = 0;
visited 1081 days, 270 consecutive
See what it does to people.
SEE WHAT IT DOES
@Borgleader, I've had that problem before.
My friend ran into that problem as well
00:02
When I changed const char *s to std::strings and forgot to change that.
Hello.
Pre me getting C++11.
Hi
The only useful implicit conversion is bool coercion.
Everything else should die in fire.
short > int > float > double
also useful
Promotions between same-class types, maaaaaaaaaaaaaaybe. I'm not a fan of having multiple fixed-size types of the same class, but whatever.
int > float, no.
00:04
I like how C# has a decimal type for no floating-point error.
So does Java..
Less exceptions the better. I prefer strong typing and bool coercion is pretty much the only one I would make an exception for.
Maaybe.
It's less useful once you leave confines of (P)OOP.
Whats wrong with OOP?
@Rapptz C# copying Java or Java copying C#? More at 11!
AFAIK, C++'s OOP is bad compared to others.
Xeo
Xeo
00:06
How is it bad?
I'm going to toss $5 on the former.
Functional programming best programming.
I haven't had the chance to experience "good OOP" though, so I can't say.
Maybe I'm just not used to it still but I've done both functional and OOP and I still prefer OOP
00:07
@TonyTheLion He's here?
Also generic programming.
Generic operations on specific data.
Xeo
Xeo
5
A: Unexpected Template deduction

XeoSadly, std::string is constructible from nullptr, see here, specifically (5): basic_string( const CharT* s, // <== 'nullptr' matches here const Allocator& alloc = Allocator() ); Note: 5) Constructs the string with the contents of null-terminated character string pointe...

:)
And this, kids, is why implicit conversions are dumb.
@Borgleader "here" references the linked picture....
Yeah I still don't get the bear thing...
00:09
@CatPlusPlus are you drunk?
No. That previous question made me wish I was, though.
cause you said more than you'd averagely say on an entire day. :P
LOL
@TonyTheLion I was going to post that but I somehow considered it NSFW..
@Rapptz oh c'mon. That's not NSFW in my books, and it's weekend, no is actually at work.
Xeo
Xeo
@TonyTheLion That means we can post tits?
00:11
I remember a discussion about clothed women being NSFW. I think everything is NSFW here..
@Xeo I don't care.
@CatPlusPlus Why not? It's Saturday night - try harder. I've been working on it for a couple hours now, and I'm pretty sure I'm getting there - I can understand most of the posts here.
My flatmate is asleep and drinking alone is alcoholism.
Waking people up for that probably is, too.
00:13
You can drink with your online buddies.
00:27
@Xeo No class type vars, no virtual ctors.
Xeo
Xeo
How does having "class type vars" have anything to do with good / bad OOP? Meta objects are subject of reflection for me.
And what are "virtual ctors" even
@Xeo a faq item
but i don't know about martin's reference
Haven't read the faq, yet. When I find them, I'll read them:)
@CatPlusPlus no, it's just sensible, e.g. if (A) you really like the stuff (say, Glenfiddich), or (B) the goal is to be drunk enough to sleep, or, say (C), you're reading a book, eating popcorn or other such stuff, and washing it down with beer (say, Carlsberg)
I'm pretty sure the only thing I have is vodka.
This is not something you drink for taste. Primarily because you lose all taste sense after two shots.
00:32
With vodka you can add all kind of essence, like, make it taste like rum
I think that was the original purpose of vodka
I have neither, but I do have 3/4 bottle of Highland Park. I'm trying not to think about it, pissed enough already..
The nice thing about beer is that it's also good for the hair!
Cause lots of vitamin B.
As in, Beer.
No vitamin V in vodka, though.
But vodka can be used to sterilize wounds, which is nice if one gets into fighting
Me I'm just drinking coffee
In the old days in Norway, when people gathered to have a party, the women brought "corpse clothes" and sometimes even coffins, for the aftermath
Better to be prepared!
:-)
@Cheersandhth.-Alf Good for hair.. where, exactly?
Mostly on the scalp, I believe
Dunno about armpits, groin, chest and so on
I think, for those body parts, if hair growth is desired, you just add a thick layer of chicken shit, like a cake, sort of, and let it be there over night
At least that's reputed (?) to work
I don't know anyone's tried it, though. There is possibility of skin damage from ammonia.
Of course, if one tries it, then it can be washed away with beer
@Cheersandhth.-Alf I was wondering whether to forward your post to Anne, maybe it would cut her beer consumption down a bit. Any more darts 'committee meetings', and we'll be bankrupt :(
00:40
Of course, feel free!
Do I know her?
@Cheersandhth.-Alf Oh, we do that. Doesn't change a fact that you stop feeling it after a while.
It's cruel mistress. Or something.
@Cheersandhth.-Alf Probably not, unless you frequent women's darts league matches round here. She would be the one being slid along the sidewalk in the general direction of the car park at closing time. It's fairly easy in winter 'cos the low friction of the ice, but a pig of job in summer, even when there's four of us pulling:(
Ah, she doesn't quite pull her weight, so to speak
Oh well
Maybe she just doesn't realize the gravity of the situation
00:51
@Cheersandhth.-Alf It's worse at the other end. There's no-one to help get what's left of her out of the hatch. In summer, easiest to throw a duvet over and leave in the car.
hello people , my Professor really likes to write method declarations like this :
const Vector3 & GetPosition( void ) const;

I get the point of the const at the right end of the declaration, but whats the point of the first one , you can very well return the value from any method into a non const variable and modify the shit out of it ! and that return really has no existance beyond this initial assignment (well unless its a pointer whose scope transcends the method itself)
Not without const_cast you can't.
@angryInsomniac it looks like an optimization
i react more to the needless and noisy Get prefix
@Cheersandhth.-Alf umm, what kind of optimization would that lead to ?
00:59
not the least because it's a Java-ism (it does make sense in Java), so it betrays the coder is not quite proficient in C++
@chris really ? I tried and it works without any casting whatsoever
@angryInsomniac if the vector is large enough, it's more efficient to just return a reference, instead of copying
@Cheersandhth.-Alf Yeah , I get the returning of the reference , no problems there , but why the const reference ?
@angryInsomniac, Consider this.
Of course it's pointless, but that's what I'm taking from it.
@angryInsomniac to avoid the caller being able to modify state of the object (the vector is part of that state), and to make it possible to call the method on a const object or via an rvalue expression
Maybe they should produce vodka with added vitamins?
@angryInsomniac, That won't modify the original.
@Cheersandhth.-Alf "to avoid the caller being able to modify state of the object" thats what the const at the right end is for
yes. and as a const method it can't return a reference to a non-const part of the object
you can just try it out
@chris hmm , i get your point , but that basically means that if you're returning something whose scope is not limited to the method itself then the const in the beginning makes sense
01:04
@angryInsomniac, Yeah, it's generally better if you don't want it modified to pass by const reference than by value and making copies.
@chris Hmm , prolly would make sense there , I was mostly dealing with methods that return temp variables and stuff though
@angryInsomniac i don't know if you got that. but if the return value was a reference to non-const, and that reference was to a vector that was logically part of the object, then the caller would be able to modify the state of the object, via the const method's result
@Cheersandhth.-Alf yup, got it :)
@Cheersandhth.-Alf only if you store the return value in a reference though, not if you just store it in a concrete variable
Bah, I need XMPP MUC and what do I find out? My client doesn't have 'em.
Why do IMs always have to be so annoying and useless.
Why is defragmenting so slow?
01:20
Oh yeah, forgot I was going to do that, thanks.
@Rapptz Because HDDs are slow.
I read something about an HDD that could do up to a couple TB/s by a laser heating it many times a second so the magnetic poles switch much faster.
But the laser was huge at that point.
Not to mention I wouldn't want that inside my computer any time soon if it's heating up to 700 degrees C or whatever it was.
700 degrees C. Are you sure?
Meh, it was like a year ago I read it.
Oh, apparently it said 800.
I thought HDDs doing 1TB/s was great until I heard about the warp drive.
Lithium's melting point is 454 K. Just as a point of comparison.
01:34
Pity I'm not required to present "What's new" to my class any more.
Xeo
Xeo
@chris "sub-picosecond laser pulse"
I think you missed that part
I said many times a second.
I was going off of memory. If anything, "a" should be "per".
So in the 2020s we might see that emerge. I wonder what SSDs will be like then. HDDs last longer, but you have to wonder how that changes when a laser is constantly shooting at it.
Then we'll somehow take the warp drive theory and use it to get Internet speeds as high as disk write speeds.
Though we aren't too far off on that logarithmic scale if we're talking 1 or 10 TB/s.
good evening everyone :)
Hello
how is everyone tonight? :)
01:49
Good, reading More Effective C++ atm.
nice :) I just got back from running. it kicked my butt tonight lol
So great when it's over.
indeed it is :) I managed to burn 733kcal tonight, I would'a went further, but i hadn't eaten beforehand lol
Well, passing out doesn't burn too many, so that's probably a good idea.
yeah xD
the roughest part about running, that i have found over the many countless hours I have put into it, is the feeling when your about 3/4 the way till your done. Your tired so you want to quit, but you know if you quit you'll kick yourself later for it xD
01:56
Ah, the good times I had running.
what was your average distance on your runs? :)
Not so much actual running, but one time our school did the Terry Fox run (I think on the 25th anniversary) outside on a nearby path, rather than inside.
On the path, I noticed some leaves stuck to my shoe, so I wiped it off figuring it was just wet, and got a hand full of dog crap :p
yeah, I eventually want to do a full marathon, but I have knee issues, and 8 miles is pushing it on my knees most of the time. Although on occasion i can do 9+ miles averaging 10-12 minute lap times :)
Not bad.
:) alright, im off to read for a while. Ill be back later
02:00
Oh wow, there's something I didn't remember or know that would've been useful.
Unnamed parameters don't give unused warnings.
unnamed parameters?
I have a strange feeling like I've heard that, but it never really stuck.
can you give an example? that would be useful to know lol
Like void foo(int){} instead of void foo(int bar){}
how would you get that value if something go passed to foo though?
02:02
Good for dumb winapi where you don't use half of the parameters you have to put in half the time.
You'd name it if you use it, but not name it otherwise.
And you wouldn't need to get the value.
oh cool :)
alright, now im off lol
winapi example, EnumWindows makes your callback take an "extra data" parameter, which you might not use, and see you.
02:16
http://stackoverflow.com/questions/12548683/c-passing-pointers-into-a-function-for-passing-int-arrays-out-of-and-into-a-f/12548707#12548707
Anything wrong or unclear about this?
I'd go with a vector (or std::array if it's always going to be 3).
No chance at the caller forgetting to clean up then.
you lack a verb in here (or else memory leak). but It is a good answer i believe.
In the form it is now it just sound quite colloquial if anyone cares.
@chris: good point, but the question was about returning an array so I didn't mention it
@luk32: oops, meant to write (or else you leak memory)
@Borgleader haha :) I am glad you didn't take it as a grammar nazi attack.
I've gotten to the point where when I hear "array", a container becomes a suitable replacement for the word, which makes my life terrible when looking through the C questions.
I'm not sure why the OP didn't like my comment. That link is why it doesn't work, and they said the question still stands.
02:22
@chris: Haha I feel your pain, my original instinct was to answer: Y U NO USE STD::VECTOR ?!?!
Hey guys, i got linux and it is awesome but I cant set my mind on which C++
IDE to get. any help?
g++
Try QtCreator
Xeo
Xeo
@MohamedAhmedNabil None
or start learning makefiles
02:29
@Borgleader I havent learened QT yet
Xeo
Xeo
Just take your favourite text editor with syntax highlighting and auto completion, learn makefiles, and go from there
@MohamedAhmedNabil You can use the Qt IDE without actually using Qt
@Xeo Wont i need a compiler?
CodeBlocks has downloads for Linux, and I like it enough for Windows, but I don't use Linux, so I can't say how well it'll work there.
Xeo
Xeo
@MohamedAhmedNabil makefile describes how to pass stuff to your compiler, so yeah
I've never used the Qt one, though, so I can't compare to it.
Xeo
Xeo
02:29
I'd recommend Clang
135
Q: C++ IDE for Linux?

SvenI want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE? I could find these SO topics: Lightweight IDE for linux and What tools do you use to develop C++ applications on Linux? I'm not looking for a lightweight IDE....

Is relevant btw.
@Xeo Yea but I want to make sure that the IDE I get has C++11 support
Xeo
Xeo
@MohamedAhmedNabil Read the first answer
Clang has the best C++11 support.
Xeo
Xeo
and C++11 support depends on the compiler, not the IDE
@Xeo but the compiler is part of the IDE, so what I mean is that I want an IDE with a compiler that supports C++11
@chris sure not GCC?
02:32
Nope
the compiler is not part of the IDE
Xeo
Xeo
@MohamedAhmedNabil Except it's not in the general case
@Xeo yea i know, anyways, GCC or Clang?
Xeo
Xeo
Only MSVS is tightly coupled to cl.exe, but you can actually use cl.exe without Visual Studio
@MohamedAhmedNabil, GCC isn't too far behind. wiki.apache.org/stdcxx/C++0xCompilerSupport
Xeo
Xeo
3 mins ago, by Xeo
I'd recommend Clang
02:33
afaik GCC doesnt compile C++
I don't like MSVC's C++11 support very much.
GCC G++ same difference
GNU Compiler Collection
ok so Clang or GCC not a big deal, right?
@MohamedAhmedNabil, GCC isn't too far behind. wiki.apache.org/stdcxx/…
Hmmm, how does one quote a message? -.-;
02:35
The Clang compiler's warnings look pretty cool, too.
Xeo
Xeo
Well, you canuse GCC on Windows too with MinGW. With Clang, it's a bit harder (especially exceptions)
@Borgleader, Click the arrow and click permalink.
Xeo
Xeo
@chris Clang's diagnostics are a big plus
@chris: ahhh cool thx
@Xeo, I might give it a shot sometime, but I've gotten used to most of GCC's warnings well enough.
02:36
Netbeans looks pretty sweet
And the only reason I need MSVC is because of things like interface SomeStupidInterface code some non-MinGW headers have.
But I must say MSVS is a lot better than C::B for projects.
I hate Netbeans
I prefer the latter for smaller things, though. No having to make a project and store 50 folders/files.
I have found Codeblocks supporting the GCC compiler
didnt find an IDE with Clang so far
Xeo
Xeo
@chris Try it. They're just that much better than GCC's
@MohamedAhmedNabil Just swap the compiler, Code::Blocks allows that
@MohamedAhmedNabil I don't think there is yet any IDE (except Xcode) that uses Clang by default.
02:40
@Xeo How do I even install a new compiler
@Xeo, I'll give it a shot. I still get the C::B benefits of no clutter.
@MohamedAhmedNabil, For GCC, I use this: nuwen.net/mingw.html
Xeo
Xeo
@chris That's Windows, though
I just copy-paste the MinGW folder to the C::B directory and it works fine, but it doesn't include GDB, so keep that and put it in.
@Xeo, Oh crap, I forgot about that.
Xeo
Xeo
@chris Wait, do you want to use Clang on Windows?
Will it be a problem if I just use GCC??? Seems simpler to get
02:41
@Xeo, Yeah, that would be my intention.
Xeo
Xeo
@MohamedAhmedNabil I think I'll have to push the task of explaining that off to someone else,k cause I'm gonna get a good night's sleep now.
6 mins ago, by Xeo
Well, you canuse GCC on Windows too with MinGW. With Clang, it's a bit harder (especially exceptions)
Basically, Clang exceptions don't work on Windows
Hmm, interesting.
Xeo
Xeo
Last time I checked, anyways.
I didn't even know GCC was more for Linux for how long.
I started off with Dev-C++ when I started C++ (dumb school having it in the folder), and moved to C::B, which has 4.4.1
The Ubuntu Software center has a huge amount of IDEs hmmmm
Xeo
Xeo
02:43
@chris Wow, 4.4.1 is old
Anyways, good night now!
@Xeo, The latest release of C::B is 2010
Besides the nightlies.
I should put Linux on my laptop alongside Windows sometime so I can get used to it, since I'm really nooby with Linux.
Come to think of it, it wouldn't be a bad idea to stick in another HDD and put it on that.
how can i test if a compiler has c++11 or not>
@MohamedAhmedNabil, int main() {auto i = 5;}
^ this
That works in C++03 too..
02:46
auto is pretty common.
@Rapptz, In 03 it needs a type.
Try this.
int main() {
    std::vector<int> v = {1,2,3,4,5,6};
    for(auto& i : v)
        std::cout << i << " ";
}
auto works in VC++ 2010
@Rapptz, MSVC doesn't do ranged-for yet :/
He's using GCC.
@Rapptz: does auto need the & in this case?
02:47
@MohamedAhmedNabil, Yeah, 2010 has some features.
MSVC2012 does range-for
@Borgleader, No, it'd probably be better without.
@Borgleader, Really?
Swear it didn't
@Borgleader auto i will create a copy. auto& i won't, afaik.
That's what I remember reading.. long ago.
It's an int so it might actually be faster without
@chris Yes it does.
02:48
For primitive types, it's typically better without references, but the general case would be with.
Wow, so it does.
I had a lot of disappointments when reading what was new in VS11, guess I forgot that one.
std::vector<int> v = {1,2,3,4,5,6};
I get an error on this line
"non-aggregates cannot be initialized with initializer list"
@Borgleader, That's a different issue.
It doesn't do that yet, but GCC does.
I know
Maybe my version is a little bit too old I'm using VS2012RC
Hence.. why I used my example..
Nah, 2012 Ultimate doesn't either.
02:51
VS2012 doesn't support initializer lists.
I hope they get C++11 together a bit more with 2012.
It was funny when they said they supported the <filesystem> header.
I was like wth, then I realized it was still in TR2 that they meant.
Would rather the C++11 language features and leave TR2 until C++1y imo.
http://liveworkspace.org/code/46b2ebbb482a1daef9b1bafe81f4f53b
Well anyway, this range_for compiles in VS2012
@Borgleader, std::iota
Sweet function.
@chris They have so far got the most important bits implemented (r-value references, lambdas, etc)
@Insilico, But it's annoying porting code from GCC with user-defined literals and crap lol
02:54
@chris True. I wish they had variadic templates done.
@chris: std::iota?
I think they had a survey to get an idea of what VC++ developers consider to be important features.
@Borgleader, It incrementally assigns numbers to a range.
Damn, beat me to it.
I found that while preparing a vector presentation.
So many hidden C++11 functions I keep finding.
02:55
Hah cool, it's a non-half-assed version of what I wrote
stoi and to_string were like that as well.
I wonder if those are normal in GCC 4.7.2.
@Borgleader A lot of C++ programmers seem to be prone to making half-assed versions of what C++ already provides. lol
std::vector, std::string, etc.
Who among us hasn't?
Anyway, what's everyone's favourite Linux?
Well, in my defense std::iota is new from C++11, give me a little time to get up to speed :P
I need to familiarize myself with it, maybe do more cross-platform stuff and test on it.
02:57
To me ? Ubuntu. I also tried Fedora and Mint. didn't like either
Great, now I'm debating whether to download the alongside Windows one or whether to put it on a separate HDD (which I've been meaning to put in my computer anyway).
Why not VM?
It's a good way to try different distros until you find one you like
Good point.
VMs are good for when some random phisher calls you and demands to have remote access to your computer.
I really wish my school had something better than MSVS 2008.
I need to get on how to bring 2010 Express on a flash drive without it messing up.
C::B is nice that way, especially with that MinGW distro that just requires copy-paste.
I made by Code::Block's syntax and shit look like VS2012 as much as I could
Where does it keep that file with my options?
because I hate redoing it.
@Rapptz, Put one in your C::B directory. It looks there first.
03:06
@chris You can bring a laptop?
Otherwise, it's somewhere on C:\ etc, which isn't any good at school.
@Insilico, Yeah, I prefer not lugging it there when I don't have a reason to.
It's big enough to care.
I'm a college graduate :(
I just don't want to redo it for Linux.
Actually, speaking of new things in C++11, is there a list of these anywhere? I downloaded the uh Standard but its 1300 pages long or something...
@chris Good point. My laptop's more of a "desktop replacement" than a laptop so I know what it's like to carry it around all over the place.
@Borgleader List of what?
Well new things that were added
header files, templates, ...
03:08
C++11 (formerly known as C++0x) is the most recent iteration of the C++ programming language. It was approved by ISO on 12 August 2011, replacing C++03. The name is derived from the tradition of naming language versions by the year of the specification's publication. C++11 includes several additions to the core language and extends the C++ standard library, incorporating most of the C++ Technical Report 1 (TR1) libraries — with the exception of the library of mathematical special functions. C++11 was published as ISO/IEC 14882:2011 in September 2011 and is available for a fee. The worki...
@Insilico, $400 off on boxing day. My first laptop after having a 6-year old desktop that's really slow.
I would've gotten a desktop, but I need to carry it around.
I got a new desktop recently, can't wait to run some C++ Amp code on it :D
@Borgleader, I haven't found a list of functions etc yet.
btw, I'm searching for the C::B settings file.
@chris: I have a G53SW, I feel your pain.
I couldn't resist $400 off ($1100 instead of $1500).
03:11
At that price it's definitely worth it
It's great not having to share a clunky desktop.
why do the spaceships in star wars sound like WWII DKV motorcycles?
even in empty space?
The reactions from people when I take it out in school are priceless.
@Cheersandhth.-Alf Because the films were directed by George Lucas.
@Cheersandhth.-Alf: Because space movies without sound suck.
03:12
oh, he liked motorcycles then
Greetings
my mother used to drive one of them DKV motorcycles
@Chimera Greetings
in the early 60s I believe
My, Chimera, you're looking great and mythical today.
03:13
Why thank you!
@Rapptz, For the C::B settings file, try Program Files\C::B\default.conf.
I guess it saves it differently when C::B is installed on the computer than when it's only on the USB.
very distinctive sound from the single cylinder
so our dog, called Vakt, always heard her coming up even one mile (ten kilometers) away
and that sound is almost exactly the spaceships in star wars!
I think they mention in the special features what they used for the sound of the starships
if you're really curious you might want to check those out
i like the idea of george look ass being a german motorcycle enhusiast
:-)
@chris neat
Darn, I just read through 25 pages of an English patch following its progress and it's a little over 90% done now after over a year of solo work. Too bad it isn't done yet, but at least they haven't given up. Anyway, I'm off to bed.
by the way this is how my C::B looks
03:28
Looks pretty different than mine :p
I don't really notice the changes to much when I'm using one or the other.
The default configuration is awful IMO.. way too many colours going on.
I prefer dark themes for my code editors
Like the one in Sublime Text 2
I don't mind those. Anything is better than Code::Blocks default.
Oh god why...
I use Mac Classic on Sublime Text 2
03:35
I use Monokai
Yeah that's default. I used that for a bit. I don't mind it, but the highlighting is better in Mac Classic at least for me.
user457812
04:34
Holy crap, Code Blocks O_o
-2
Q: Scanning and printing a character pointer in C

TomSTOP DOWN VOTING YOU DOUCHES AND ANSWER!!! As you can probably guess I am very new to C. I know Python and java, and I am trying to figure out the difference between a character pointer and array. I can do the same thing if I use a character array, but this doesn't work. Can anybody explain to ...

LOL
user457812
brb downvoting

« first day (708 days earlier)      last day (4466 days later) »