« first day (141 days earlier)      last day (4810 days later) » 
00:00 - 19:0019:00 - 00:00

12:22 AM
getting back to GUI after a long no GUI time is pretty awful
I'm not used to it anymore
I like coding without having to worry about GUI
 
1:09 AM
hii
any peoples here ?
 
Xeo
yep
 
 
9 hours later…
10:45 AM
hihi
 
huh activity
and a good sunday to you
 
yawn
 
hope you're ok, not crushed & burned by falling hot ladies?
 
nope
 
current last question is about writing to binary stream after seek
i seem to recall that the C standard requires a flush in between
but i'm too lazy to check and answer it
 
10:49 AM
the C Standard? meh @ that, this is the C++ chatroom
 
yes, but it all goes down to C standard
0
Q: C++: Correct use of stream operations

ArpitI am trying to learn to use the file stream correctly. The following is a snippet of code that I am maintaining. It works fine, but I was wondering whether the usage is correct and whether there are better ways to perform these tasks. For example, the use of SEEK_SET and ios::beg together. Also, ...

 
unless the C++ Standard says "Well over here, just do as the C Standard says", then I don't believe that it does
 
here i don't answer questions because it would be 2 much work, which the OP should do him/her-self. but the questions now asked in [comp.std.c++] and [comp.lang.c++.moderated], I DO NOT KNOW how to answer them. Like questions about the synchronization keywords in C++0x. I don't even have compiler that supports that stuff. I feel a bit outdated.
ok i just put a comment on that question, "check it out" :-)
 
lol
 
Morning kids!
:)
 
11:05 AM
i'm finding some basic things missing in C#, like decent grid control...
in C++, missing:
decent exceptions (need cloning for propagation through C code, etc.)
 
man
I wish I could inherit constructors
 
decent grid control?
 
@DeadMG wasn't that yesterday, someone posted link to paper saying inherited constructors should be removed from C++0x draft?
 
yeah
that's what I think was stupid
 
11:07 AM
@AlfPSteinbach Well there is less stuff missing than in Java
 
he said "OMG NOBODY HAS ANY EXPERIENCE OR EXAMPLES", and I'm like, dude, I've got an example right now
 
the only direct counter-example i recall is difficulty of perfect forwarding of literal 0 as argument
 
that's what nullptr is for
 
ibut anyway, my point earlier was that c++ misses some very basic things
 
like what?
 
11:10 AM
@DeadMG Can you show us the example?
 
like decent exceptions, immutable (efficient) strings,
 
immutable != efficient
 
at the very bottom, a standard name for byte type...
 
@AlfPSteinbach Without implicit reference semantics, immutable objects simply aren't practical.
 
so there is no const keyword?
 
11:11 AM
it's silly when just about every library and program in existence must define Byte
 
Strings in Java are immutable
 
@Nils Yes, which is quite beautiful imo.
 
@FredOverflow i and many others have implemented immutable strings for c++. they're practical. much more so than std::string
 
Unfortunately, the Java people forgot to overload == for Strings.
 
11:12 AM
now how am I going to introduce constructors without variadic templates that take the correct amount of T?
without having to duplicate the entire class
 
@AlfPSteinbach Via handle objects, I suppose?
@DeadMG C++0x has variadic templates, I don't really see the point...?
 
@FredOverflow yess IIRC Java has this immutability concept in which one should use immutable objects first unless you really need mutable objects
 
yes, but this sample just happens to be solvable with them
if I needed this class to be linked in statically, I couldn't use them either
 
@FredOverflow on the inside, is mostly just a shared ptr. but to construct from literal strings efficiently, need to use like boost::intrusive_ptr. which is another basic thing lacking even in C++0x...
 
although right now I can't use them because my compiler just doesn't support them
which is a minor suck
 
11:14 AM
@DeadMG Where's the subclass?
 
there isn't one, because I cut it as it won't work
let me just repost briefly
 
@DeadMG I'll go find my blog posting doing constructor arg forwarding for c++98...
 
ugh
I am not going to do that macro madness
 
11:16 AM
heh everybody seems to implement his/her own vector class in c++
 
@Nils: Boost only offers a dynamic length vector class
 
@DeadMG Personally, I would just make the data public so I can say StaticVector<int, 5> = {2, 3, 5, 7, 11};
Gotta love aggregates and their simple initialization ;)
 
I did it to implement gradient descend for the optimization class I too last year
 
that could work
 
but I only needed a 2d vector, so my implementation was much simpler
@DeadMG What do you need that vector class for?
 
11:20 AM
playing with writing some concurrent physics
 
ok
 
@Nils Using const on std::string does not reap any efficiency benefits
 
ah.. maybe didn't think about it so far.. But the compiler can optimize better if you use const, right?
 
not really
 
In the majority of cases, const has nothing to do with optimization.
 
11:22 AM
brb brukfust
 
good luck
 
enjoy
I read some discussion about when to use const and when (or when not) to use preprocessor macros, but cannot find it right now
 
@Nils How do you use preprocessor macros to simulate const correctness?
 
not at all
 
nomnom
 
11:35 AM
You forgot one "nom", I believe it is called "nomnomnom". Or is it?
 
uh, strictly speaking, there's like ten in a row
nomnom nomnom nomnom nomnom nomnom
the actor says it very fast
but I'm pretty sure that "nom" is valid however many times you choose to repeat it
 
Here's something I don't understand. How come boost::bind supports operator==, but std::bind does not? Was that an oversight or a deliberate decision?
 
Lambdas
 
Did not exist in TR1 yet.
 
std::bind isn't tr1 either
 
11:38 AM
Okay, I meant std::tr1::bind, sorry.
 
then I don't really know
they're all completely redundant after lambdas anyway
 
Yeah, kinda...
What I am really looking forward to in C++0x is the new for loop. Makes code a lot shorter than std::for_each(foo.begin(), foo.end(), crazy-lambda-syntax {} );
 
I'm not
std::for_each is great
you know how much effeort
it takes to convert std::for_each into Concurrency::parallel_for_each?
yeah, nowt
 
What's not to like about for (auto& x : container) { ... }?
 
where's parallel_for(auto& x : container) { ... }?
it's not extendable
 
11:42 AM
You cannot simply parallelize everything just by adding a parallel_ prefix.
With concurrent code, the loop syntax is your lowest concern.
 
I can if it already had a parallelisable body
 
Right, if...
 
parallelisation is just one example
std::for_each is extendable
the other syntax isn't
 
parallel_for from Intels TBB?
 
@DeadMG What do you mean? How is it extendable?
 
11:43 AM
well, as I just demonstrated, because for_each is just another function
but the range-based for is "special"
it's syntax cannot be replicated, it's functionality cannot be altered
@Nils: VS10 comes with a Concurrency runtime that has one, but yeah, it's basically the same beast
 
@DeadMG Altering functionality is not always good. That's why Stroustrup explicitly disallowed operator overloading for built-in types.
 
there's nothing built-in about any of this
or rather
 
So the traditional for loop isn't built in, either?
 
there shouldn't be
sure, but nobody is espousing that as a solution
 
The whole C core is "built-in".
 
11:48 AM
and nobody is suggesting even using it, let alone altering it
 
References are "built-in". Const correctness is "built-in".
Classes and objects are "built-in". If you don't like that, you can always convert to LISP ;)
 
so what? that's completely tangental to my point
there are features built in to C++, therefore we should build in more features?
 
I say there's nothing wrong with hard-wiring features into a language that are often used, like "loop over each entry in this range".
 
it already is hard wired
std::for_each
 
Apparently, lots of people agree, otherwise the feature would not have made it into C++0x.
 
11:50 AM
and I really don't care about them and the discussion never even considered them?
 
But telling for_each what to do is relatively painful.
 
if you don't have lambdas
 
for (auto& x: container)
{
    std::cout << x << std::endl;
}
What is the corresponding for_each version, with and without lambdas?
 
std::for_each(container.begin(), container.end(), [](type& x) {
    std::cout << x << std::endl;
});
without lambdas? who cares, discussing C++0x here
 
Right.
You can't say auto here? Not good for generic code. What if you don't know the type?
 
11:53 AM
you can use decltype
 
decltype of what? container.begin()?
 
*container.begin()
 
What if you don't even know the type of the container... what if it is an array?
 
if you can refer to it, you know it's type
and if it is an array, then there is std::begin and std::end for this purpose
ignoring the fact that you should just use std::array
 
I guess decltype(container.front()) would also work? :)
 
11:55 AM
if container offers that
or decltype(container)::value_type&
 
Anyway, I find for (auto& x: container) a lot more readable than std::for_each(container.begin(), container.end(), [](decltype(container.begin())& x), and I believe lots of beginners would agree. Remember that one of the design goals of C++0x was to make learning C++ easier for beginners.
And I think iterating over a container is more important to learn than anonymous functions.
 
anonymous functions have way wider application
 
Which implies there's always room for specialized alternatives like the new for loop.
 
no, it doesn't
 
Are you seriously telling me there is absolutely no point in the new for loop, even though it makes one special case a lot simpler to write?
 
12:07 PM
yes, I believe that the flexibility offered by std::for_each far outweighs the few extra characters to write
 
From the first proposal:
> Being able to iterate over a range of values is common operation that is unnecessarily difficult and verbose in current C++. This makes the language harder to use for novice and experienced programmers alike.
> Just about any modern language has added a "for each" construct and C++ should do the same to make the language more accessible.
 
current language doesn't include lambdas
ultimately, it's not that I'm against the new for loop or something
I'm just gonna keep using for_each
 
Hm... do you think the new for loop would never have been suggested if C++03 already had had lambdas?
 
yep
 
interesting
 
12:12 PM
I think it's a knee-jerk reaction
"Our current iteration support sucks, and OMG ALL THESE OTHER LANGUAGES, THEY MADE THEIR OWN!! GO GO GO"
I think that they should have waited until after C++0x was done and verified that lambdas weren't enough of a solution
 
12:31 PM
what's wrong with adding fir_each? It's a nice feature, specially if they make it so that more or less all of the STL containers work with it.
Morning btw :P
 
nothing wrong with adding it
it's just unnecessary
it works with STL containers by calling STL functions
I think that's wrong
the language should never call user-defined functions
the coupling is too tight
 
I would say that do loops are unnecessary, you could just manually put the first iteration of code before a normal while loop
 
that's code duplication and BAD
 
which is why it's nice that you have a do while loop structure
 
the new for loop does not have any advantages over for_each like code duplication
 
12:35 PM
I see what your saying about it tightly linked to the STL containers...
 
code duplication reudction
 
Python has no do-while construct. I don't miss it very much.
 
 
2 hours later…
2:42 PM
2
Q: Not using parentheses in constructor call with new (c++)

Mr_and_Mrs_DSo I had in my main: Class* pC = new Class; It was working as Class* pC = new Class(); I realized just today that I had omitted the parentheses (so I was hit by the "opposite" of the most vexing parse in a way). My question: Are these two forms equivalent ?

vote to close, please
 
3:01 PM
hm, there's no "vote to close" on Usenet
 
 
1 hour later…
user379888
4:27 PM
When doing inheritance,do we place each class in a separate header file or in the same base file?which one is a better practise?
 
Generally, each class has its own header and source file
if you want to inherit a class, you include the header file that class in the header file for the derived class
 
user379888
thankyou
 
no worries
 
inheritance? the only language feature that makes a difference to where you put header/source files is templates
 
user379888
@DeadMG: What to do when making templates?
 
4:48 PM
whatever you can get to compile, frankly
 
user379888
Can anyone help me out with some good checks for taking price of books as inputs
 
user379888
except of the amount range
 
@fahad can you try to rephrase that?
 
user379888
@AlfPSteinbach: I want to put some good checks for the input so that my program does not have a bug in entering real world data in the program, for that I need some good advices regarding checking for the float type data named cost_ .If the user enters a very big amount or anything else except numbers it should prompt
 
@fahad sounds like you need to dry run your logic
 
5:02 PM
@fahad: First, ensure that the operation succeeded
 
@fahad read or otherwise obtain one line of input into a std::string (e.g. using std::getline). construct a std::istreamstream with that string as contents. read number from the stream. check stream failure mode, e.g via member function fail.
 
if (!input >> cost_) AlertUserAndMaybeThrow();
then you want to decide on lower and upper boundaries for cost_ that is reasonable
 
@DeadMG if only it was that easy to throw the user :P
 
lol
 
user379888
@AlfPSteinbach: Can you please provide me with an example code snippet?
 
5:07 PM
ergh... report writing sucks ass
 
user379888
@thecoshman:Abusing in public chat rooms is not appreciated
 
@fahad Abusing? What 'you mean?
 
user379888
Using non-formal words
 
@fahad: Formality sucks balls
and non-formal words are still valid English and therefore completely allowed
 
user379888
This is horrible
 
5:11 PM
@fahad forgive me If I sound like I am 'trolling', but what do you mean? Sorry if I offended you
 
user379888
@thecoshman:There is no need for an apology.I just wanted to point out that using words like as* and suc* are not considered a gentle way of chatting. Still many people use them so often
 
user379888
Even I dont like report writing :)
 
Considering this is a chat room, I write how I speak. As such if in normal speak I would say I thought something sucked ass, I am dam well going to type it. I am not going to hide behind some thin vale of stuck up formality. Having said that, in real life my language tend does tend to feature more fuck and bull shit, but I can can cope with being bit less crass when it comes to talking to random people
Never new their was some sort of taboo meaning behind the word sucks
 
user379888
This is ofcourse your choice.Just wanted to point it out as it is not considered good in the west.
 
5:21 PM
newspaper article today says employers regularly check what prospective empoyees have written in chat rooms and published on facebook
 
Maybe I don't live west enough, but never heard anyone having issue with it
 
@thecoshman u have to think of more than US
 
@AlfPSteinbach I don't live in the US, I'm English
 
user379888
I completely agree that it's quite common in some countries but where English is not the mother tongue than I guess they dont abstract out anything good from these words
 
oh. sorry for fucking confusion
:-)
i liked the xkcd strip about "my hobby: mixing curse levels"
lemme see if i can find it
he he
 
5:25 PM
@AlfPSteinbach well it's not fucking on! Your racist assumptions that I am American! (can't quite resist at least mentioning desire to make reference to Nazi ways)
@AlfPSteinbach wow, that must be an old xkcd
oh, forgot :P
see, following up the most raving swear-fest with a smiley makes it all ok
 
but really, swearing in English is almost impossible, because it's all at the level of just invoking some "not nice" words
swearing in Spanish, though, that's something!
i'm almost thinking about learning Spanish, just for that
 
@fahad So what does 'sucks' imply that makes it so bad? I am really curios, like I said, never heard any one imply their was something wrong with it
@AlfPSteinbach what do you mean? Words like bastard actually having a sensible meaning to them, but only being considered 'swear words' because they are
 
u can say: "ur program sucks more than miss Lovelace"
and when the person asks "Linda Lovelace?"
u say, "Nah, Ada Lovelace"
oh, there my future employer-employee relationship went down the drain. dang!
@thecoshman: that was about the etymology of "sucks" ;-)
 
right... still don't see how it can be considered so bad. It's not like (Yes I dare to say it!) the word 'niga' which needless to say has a horrendous amount of racism behind it, probably a lot more then people really think about when they say it.
 
hm, well, it's probably time to start flagging comments as offensive, just for fun
 
5:36 PM
saying that something sucks, when it is obvious that it is not physically sucking, it has the implied meaning of it being bad. And this implied meaning can be used to say something 'sucks more' or is 'more bad'/worse. As far as I am aware, that's all the meaning their is behind saying something sucks... like my report
@AlfPSteinbach on the off chance you are serious about flagging comments, I will happily remove them if you think I have over stepped the line. I would rather not have flagged comments against my profile
 
@fahad: you still need code snippet? I didn't see that question, sorry.
@thecoshman how do you see if a profile has flagged comments?
 
@AlfPSteinbach I'm just assuming that as comments get flagged, it's going to be logged against your profile, with the possibility of banning for repeat offenders.
Oh crap! Need to write a little four page section on terrain level of detail, done an intro thing as to why bother, spoke about basic culling methods and ROAM and my four pages are gone! I need to see if this is a very strict upper limit else I am going to need to do some serious cutting down
 
I do love these comics.
 
6:02 PM
Some people wash their hands after they pee. I wash mine before I pee so I don't get my dick dirty.
:D
 
@Nils epic
 
Goodness gracious! Crikey!
Great! Gosh! Golly! Wow! Good lord! Well I never! Really!
Oh! Tremendous! Fantastic! Terrific! Sound! Fancy!
Just fancy that! You don?t say!
 
@AlfPSteinbach o_0
@AlfPSteinbach where are you from, keyboard wise at least, because when you write don't, your apostrophe is a question mark for me, and I assume you didn't write it like so
 
@Nils Urine starts out sterile, so as long as you don't have something like a urinary tract infection to pollute it, he's got a pretty good point. The uric acid in urine also helps kill bacteria, so it's actually a fairly good disinfectant (during wars, for example, it's often been used to clean wounds).
 
i used copied & pasted. apostrophe looks like this: <<`>> or this: <<'>> or this: <<doesnt work>>
 
6:16 PM
lol @JerryCoffin did u read that on wikipedia?
 
the question is, should one always have better/more expensive dinner on sunday?
 
sure why not
 
but that discriminates against the other days
 
I usually watch tv while eating.. what could I watch now?
 
the deserve it for making you work on them
what's Sunday ever done wrong, nothing
 
6:28 PM
why is it that rendering APIs suck so badly?
I got a little sick of writing my own, so I went and looked at OGRE
oh look- five minutes and I found a Singleton
:(
 
@DeadMG what for?
 
what do you mean?
 
lol
rendering API == 3d engine?
 
no
 
what r u using it for?
 
6:39 PM
a rendering api is just part of an engine
I'm not, I was thinking about using it for a game
 
unreal, unity, cryengine?
 
you mean the ones you have to pay for?
 
@DeadMG what part of it was using singleton?
 
there's Ogre::Root, whatever that does
and a SceneManagerFactory, Jesus, just let me make an Ogre::Scene
 
Isn't OGRE a full game engine, more then just a render?
 
6:42 PM
Open Graphics Rendering Engine
it's just a rendering api
 
you do not have for Unreal, unless you make a certain amount of money; crytek has free university programs AFAIK
 
pretty sure for UDK you have to pay a hundred dollars up front
 
@DeadMG only when you want to sell your game
 
@AlfPSteinbach Hmm!, I've only just been allowed to participate in a stackoverflow chat room for the first time today. I'm rather disappointed with the amount of abusive language that I see in what is probably the only room I might probably join in. I personally find this level offensive, and am unlikely to participate if it continues. I will be flagging messages that I find offensive as such, and not just for fun. Starting NOW!
 
during development it is free to just use. And once you have made $50k you pay 25%
 
6:45 PM
I still have to pay that money, it doesn't magically go away just because I'm paying later
 
@bobinski Really? Because I have been participating in this chart and not found anything offensive. Care to give some examples?
@DeadMG true, that's the same reason I chose not to use it
 
Most of your input actually.
 
@bobinski: This chatroom is for everybody- including those of us who choose to use that language
 
Goodbye then, I'm NOT returning................................
 
ok have fun
 
6:48 PM
@bobinski cheers, saves us from having to put out with a pain in the arse
and as a side note, do let me know if I am letting slip a few too many fecks for your liking
 
@DeadMG no
 
oh, i just missed the visit by @bobinski -- who appears to be a C# person aiming for C++. it would have been better to welcome him, i think. converts are good.
 
@DeadMG udk.com
 
what's up fellows?
 
@Alf: I'd be perfectly happy to convert him, but I'm not going to censor the room
 
6:59 PM
@AlfPSteinbach I am a convert
but you prob didn't realize ;)
 
00:00 - 19:0019:00 - 00:00

« first day (141 days earlier)      last day (4810 days later) »