« first day (782 days earlier)      last day (4152 days later) » 

4:03 AM
Chirst VS is taking a lifetime to update.
I'll play a game or something...
 
Conversion of a Java 2.0 Embedded project into a C++ project. No documentation, can't find the original included firmware libraries and I'm missing circuit diagrams.
Wheeeeeee
How is everyone else's day going?
 
Writing a condemned essay for the requirement class, Cognitive Psychology.
 
4:30 AM
@ThePhD With the CTP, you can write code that accepts an initializer_list without a problem, though the standard library doesn't include it, so you can't use an initializer_list with, say, std::vector.
 
@JerryCoffin You've... lost me.
 
In the November CTP, the compiler knows about initializer_list, so you can write code that accepts an initializer_list. The standard library, however, has not had all that code added, so (for example) it doesn't include a ctor for std::vector that accepts an initializer_list.
 
So I just have to write my own make_vector( initializer_list ) ?
Strangely, though, initalizer_list is not a header in the November CTP
OH WAIT
This is where I realize how dumb I've been. :3c
 
@ThePhD Yes, it is. In fact, it's the only header included with the CTP.
 
I haven't changed teh Platform Toolset to VC++ 2012 CTP.
 
4:34 AM
@ThePhD That would help.
 
Why don't you do the update?
 
IIRC, using {symbol} = {stuff} is not... allowed yet? In VC++2012?
 
try template<typename T> using ptr = T*;
 
Xeo
No, using aliases are one of the still missing things.
 
oops bad order.
 
Xeo
4:39 AM
One of the dearly missed things, if I may say so. :(
 
that sucks
 
So tehy'd just have to be typedef
Well, I hope Robot doesn't mind typedef...
... Does constexpr not exist either? D:
 
The benefit of the using keyword is for type alias with templates
typedef wouldn't support those
 
Well, so far I haven't encoutered type aliasing with templating just yet
It's just things that could be replaced with a straight typedef
Okay, constexpr is not supported but its everywhere...
 
gl
 
Xeo
4:43 AM
#define constexpr const works for the most stuff.
 
... What the fuck did DeadMG mean this was almost ready for VC++? This thing can't compile in the mother fucking slightest.
 
Xeo
Or really, a search-and-replace.
 
@Xeo I think Robot wouldn't want me to kill constexpr, so #define it is. Now I just need to... define it somewhere.
 
the top of the file
 
Xeo
@ThePhD /Dconstexpr=const or however the MSVC syntax was?
 
4:44 AM
@ThePhD This works: ideone.com/zwOgIE
 
@Xeo I just put it inside an #ifdef _MSC_VER
 
Xeo
Meh, project-wide defines should be left to the project.
 
Well, it's more of a compiler-specific define, really.
Oh, MSVC doesn't have literals either....
 
whats a # pragma?
 
#pragma once?
 
4:49 AM
@Arcturus Something that causes implementation defined behavior (typically gives a directive to the compiler, on the same general order as something you could pass on the command line).
 
Interesting, thanks @Jerry
I only know of #error #lineno and #include among other C++ drivel! Never had to program the bare metal
 
Man
I never thought VC++ was so featureless...
Literals are gone, no unicode literals.... just trying to look at Ogonek makes me feel so terrible
 
Given all/most Ph.D.s in the USA end up in wall street, after half-decade of indentured servitude, why is it so glamorized on Stackoverflow? Yet to find out
 
what?
You know if you go into the sciences you pretty much are implicitly required to get at least a Master's degree or higher.
That isn't a "wall street" job
 
5:05 AM
Rubs face.
Ogonek is turning out to be a lot more trouble than continuing to roll my own solution.
 
Xeo
No.
 
Probably for the exclusive reason that VC++ apparently doesn't support a lot of stuff.
 
Xeo
MSVC is turning out to be a lot more trouble than switching to something else. :)
Yep.
 
GCC 4.7 works best for me.
 
Xeo
using aliases and constexpr, really.
 
5:07 AM
For some reason I have trouble compiling my projects with clang.
 
Xeo
If you take the fixed Nov' CTP into account.
@StackedCrooked Doing it wrong, obviously! :P
 
@Xeo MinGW support of DirectX is not the fanciest, and since I want to actually enter a few competitions to win some money (which require DirectX or VC++).
 
@Xeo I guess.
 
Well, @Rapptz, I've had people tell me, they "hope to make it to Goldman, to make Sacks of Gold". Eventually the few win, but great to know the many who throw your hat in the ring!
 
@Xeo They have the operator"" literals in the CTP?
 
Xeo
5:07 AM
@ThePhD Oh, right, those are missing but not essential to Ogonek, I'd say.
 
or the regular 'U' literals that ogonek has in a bunch of places? @__@
 
Thanks all; I gtg. Goodnite from EDT.
 
Xeo
@ThePhD Heh, unicode literals.
 
@Xeo Yeah, but they're used a lot of everywhere.
Maybe Robot wouldn't mind if I start actually doing some syntactic damage to things...
 
Xeo
@ThePhD I can only imagine them being used in the tests.
 
5:09 AM
@Xeo Nah, windows1252 and other places, they're there.
Albeit, looking at it all closely I can probably just chop it off.
... Aren't you supposed to never be allowed to initalize arrays inside of a struct, unless outside the class?
Or is that another C++11 thingy?
An integral array, anyways.
ideone.com/3iq7Fc <--- Anyone know if that's supposed to work natively in GCC 4.7 ?
 
@DeadMG wow, you submitted a pull request where you rename all files?
:D
 
Xeo
@ThePhD Try it on stacked-crooked.com?
 
... You're right! I have Stacked Crooked's site!
 
Xeo
And yes, it works.
 
So it really is just VC++ being a dick...
._.
I've lost hope in VC++.
Time to see if I can turn over to MinGW and still enter in these competitions..
 
5:22 AM
@StackedCrooked on what? the robots unicode code ? o.o
 
@ThePhD, Last I heard, nothing on any in-class member initialization for VC++ yet.
 
@Borgleader Yep.
 
rofl...
 
I'm just gonna build my own unicode implementation unfortunately.
Tackling all these compiler errors is just going to go way above my head.
... On the bright side, I now have boost and friends eternally.
So something good came out of this?
 
@ThePhD A PhD?
 
5:25 AM
@StackedCrooked And PhD in "Compiler Deficiencies", maybe.
 
Xeo
@ThePhD Do you know if those arrays are used in contexts where a constant expression is required?
If not, there's a rather easy workaround.
 
@Xeo constexpr isn't really the problem. It's jsut where teh arrays are defined. I'd have to define them outside the class, which could be a problem if there are multiple translation units, which means I'd probabyl have to define another thing like OGONEK_COMPILING for the stuff defined outside of the structs (that's the way I do it in my engine presently)
 
Xeo
I'm not talking constexpr, I just want to know if those array values are used as a constant expression.
Say, a template argument or array size or something.
 
Um. I think you've lost me. At present, no, I don't think they're used like that. I haven't gone through the whole codebase, though. (If that's what you mean)
 
Xeo
typedef codepoint const latin1_mapping_array[TheSize];
static latin1_mapping_array& difference_latin1_mapping(){
  static latin1_mapping_array arr = { ... };
  return arr;
}
 
5:30 AM
#peoplewithtoomuchfreetime
 
@Borgleader You suck at linking.
 
also lol @ the first comment: "I had discussions like this with my teachers and the argument basically went like this. In the old days, hardware was expensive and programmers were cheap, so you needed elegant, hand-optimized code. Now, hardware is cheap and programmers are expensive, so you can just go ahead and write everything in Java. It's hard to argue with the logic, but I can't help but still think of programming as an art, rather than just churning out code."
@Rapptz Not my fault if it doesnt take links without http://
 
So is!
Jerry might be one of the people who has gone through the change between old days programming to current day programming.
 
Xeo
@ThePhD and then using X::difference_latin1_mapping()[x] instead of X::difference_latin1_mapping[x]
 
@Xeo ... I don't even...
 
Xeo
5:34 AM
The only "hard" part is finding out and hardcoding the size into the arrays.
 
@Rapptz He's that old huh? He must feel like Yoda around here...
 
He's only 48. But most of us are in our early 20s.
 
Xeo
I think the ape and @Jerry are pretty close age-wise, from what I heard.
 
@Xeo how old are you?
 
Xeo
21
 
5:36 AM
fuk
I am going to hang myself
 
Xeo
Have fun.
 
you guys are too good
 
R.I.P. billz, Unknown - December 5, 2012. Will he be missed? Who knows.
 
Meet a challenge? Kill yourself so you never meet it. <--- A Great Plan.
 
It's not even any challenge
I am fuken too far away
 
5:38 AM
Just gotta learn.
 
@billz Are you kidding?
I'm a noob
 
Xeo
In C++, everyone is a noob.
 
ahah, stop @Xeo
:D
 
@Xeo In C++11, everyone is a noob. I've been a noob in C++ half a dozen times already.
 
Xeo
:)
 
5:40 AM
I keep learning cool things about C++11, I like it.
 
... Lulz.
 
I am on SO for one month(registered 1 year ago), but I see so many talented ppl
 
Xeo
room topic changed to Lounge<C++>: Something something Puppy something Cat something Robot something. [c++] [c++11] [c++-faq] [newbz-only]
 
VC++ is starting to get on all my nerves.
 
cpx
I haven't even started with C++ yet. I'm still learning C.
 
5:41 AM
@billz It's the cheerleader effect messing with you bro.
 
Xeo
@cpx "still"? Are you going to learn C++ with your C knowledge?
 
@Rapptz I need to hug a hot girl to calm myself down
 
cpx
I hope so.
 
Xeo
If yes, full-stop, rewind, and restart from the beginning right with C++(11).
Learning C as a stepping stone to learning C++ doesn't help you whatsoever and is more likely to actually hinder you.
 
I'm a good example of that. :)
 
Xeo
5:43 AM
You don't know C, so no. And you don't know C++, so you're out of the discussion.
4
:)
 
Oh you're right...
 
What language was ycruncher written in?
 
Clean C
 
Xeo
It was written in "help-me-I-want-to-be-C"
2
 
A subset of C that compiles in both C and C++.
 
Xeo
5:45 AM
(Okay, I'll stop (for) now.)
 
It was written in BASIC. Trust me.
 
There are a few places where, if you set the right options, it'll switch to a cleaner C++ implementation.
 
Xeo
@Mysticial With templates or in what way?
 
There's one place in the entire program that needs an abstract class.
 
.... Yeah....
 
5:46 AM
Figures it's only a class. :(
 
I'm sure ogonek works great for Robot, but I can't wrap my head around it.
 
So in C++ mode, it'll use an abstract C++ class.
 
Back to rolling my own...
 
Maintaining several implementations of the same thing doesn't sound 'cleaner' at all.
 
In C mode, it'll use a function pointer with a vtable.
@LucDanton It was never clean with all the optimizations. :P
 
5:48 AM
I feel kind've bad though.
It's like I'm just not smart enough to use ogonek. =/
 
Xeo
Crap, almost 7am...
 
lol
 
Xeo
Sleepy time, bye!
 
@Xeo You haven't been sleep talking all this time?
 
night
 
5:48 AM
Goooood night.
 
night
 
Xeo
@ThePhD *typing
And no, not today.
 
cpx
Secret german skills.
 
Xeo
The skill's on cooldown.
 
The one and only abstract class that I needed in the entire program was for swap-file handling.
Basically, I have made a "raid-file" class that implements a basic file IO interface. But instead of using a single file, it actually uses multiple drives under RAID0.
Initially, calls to that file IO interface were hard-coded.
But then, I wanted to implement a better underlying "raid-file" class.
So I ended making an abstract "RaidFile" class that has all the normal I/O calls.
Then I wrote the hybrid raid 0-3 class and inherited from the abstract "RaidFile" class.
So now I can completely swap out the under-lying implementation with another one whenever I want to.
 
That map could use some nicer initialization.
 
Does the existence of any constructor prevent a class from becoming part of a union?
 
@Mysticial C++11 has improved unions.
In C++03 declaring a constructor prevents from using the class in a union, yes.
 
neat
Cause I had a very simple struct. I added a constructor to make initialization easier, and it blocked me from putting it in a union.
 
6:04 AM
It does mean that such a union gets deleted special members by default though.
 
@Mysticial Makes sense. Suppose you have a union of A and B then how could the compiler decide which constructor to call?
 
It's also not a super widely supported feature atm I think.
 
@StackedCrooked I had no default constructor. I added a simple constructor so that I didn't need to use 4 assignments.
I suppose I could've just used a set() method.
 
If you have a user-defined constructor then the default constructor no longer (automatically) exists.
 
You can factor out the part that you want to put in a union and have the rich interface be a non-POD.
 
6:47 AM
I've a quick question: does this code invoke undefined behavior?

return do_something( getStdString(someargs).c_str() );
 
@Nawaz I think the intermediate lives until the entire statement is done.
 
entire statement? or entire/full expression?
 
I believe it's the full expression.
 
Could always step-through and see if the std::string destructor is called before you want it to be called.
 
yeah. then what is full expression? getStdString(someargs).c_str() or do_something( getStdString(someargs).c_str() )?
 
6:50 AM
I think it's the latter.
 
@ThePhD: that is not a nice idea, I think.
 
In other words, you won't shoot yourself.
 
hmmm..
 
But I'm not 100% sure though.
 
hehe. Even I'm not 100% sure, that is why I'm raising this doubt. :|
 
6:52 AM
@Nawaz I don't see how tha't not nice. C++ will fold everything out one at a time. Break at teh end of getStdString, step out of that, step into c_str(), step out of that, then start stepping through. If std::string's destructor gets called anywhere, something horrible probably happened and an intermediate died that shouldn't have.
 
@ThePhD: What if the current compiler has that particular bug? and in the next version it gets fixed?
 
@Nawaz Deal with it? This isn't about finding a bug, this is about making sure what you're doing works.
 
7:15 AM
@Nawaz "Temporary objects are destroyed as the last step in evaluating the full-expression (1.9) that (lexically) contains the point where they were created. This is true even if that evaluation ends in throwing an exception."
As such, the string returned from getStdString cannot be destroyed until the end of the return statement. The pointer being passed to do_something remains valid until after do_something returns (unless, of course, do_something tries to modify the buffer, or something on that order that's prohibited for the return from cstring in generl).
Oops -- "*c_str() in general"
 
@ThePhD: What works with current compiler, might not work with next version of the same compiler if the code is not correct.
@JerryCoffin: Thanks a lot for the detailed explanation. I think what I've written is correct. :-)
 
Whether or not the copy constructor will be called during Copy Initilization completely depends on the class definition.If the class provides an appropriate conversion operator which is a better match than the copy constructor then it will be used. — Als 39 mins ago
 
@Nawaz Sure -- glad to help.
 
some help pls? I don't get the part about the conversion operator
 
@LuchianGrigore: He is talking about operator T() in the same class which needs to be convert to T.
 
7:24 AM
@LuchianGrigore out of context that could be auto-plonk material, lol
Good mawning
 
@Nawaz so that would be called instead of c-ctor?
Wouldn't it result in an error?
wat?
gotta try this out
 
^ oh my. Quite an elaborate "practical troll"
 
@LuchianGrigore: Yes. See this : ideone.com/uJhk7G
 
As it stands right now, I think a few different things could happen. If vec_shots is an array of ClassA, then you'd just be binding the reference to the object in the array. OTOH, if vec_shots contains some type that can convert to classA, then it would create a temporary, and bind the reference to the temporary.
 
Nono
@Nawaz my sample shows the same class.
 
7:32 AM
@LuchianGrigore: Your example is different than mine. Also, conversion operator will not be called in your case. It has a copy-constructor.
In fact, the conversion is useless; therefore its existence doesn't make sense.
 
@Nawaz exactly. It's different because that's what I had in the answer. (the same class) and Als said it was wrong, but since he didn't have time to explain why, I asked here.
 
@Nawaz That's basically just testing out overload resolution -- the conversion operator is called because the ctor would require a conversion from A to A const &, while the conversion operator requires no conversion.
 
@JerryCoffin: A to A const&, or A& to A const&?
Isn't it already A&?
 
@Nawaz No -- you have an object, not a reference. However (at least if memory serves) taking a reference to the object isn't considered a conversion -- but reference to const reference is (but I'd have to reread that part of the standard to be entirely sure).
 
@JerryCoffin: Ohh.. I'm using temporary, so obviously it is not A&. It must be A.
 
7:38 AM
@Nawaz Exactly.
 
Also, when I've a named object, an lvalue, then the behavior changes if the constructor takes A& instead of A const&. : ideone.com/Z8WqtR
 
@Nawaz Right -- goes back to what I said before; you were just testing overload resolution, and now you've given it two equally good candidates, so you get ambiguity.
 
while it is same if it takes A const& : ideone.com/Q5g3zk
That is great. I didn't know that A& to A const& matters so much!!!
Learned something new :D
 
@Nawaz It doesn' t very often -- of all conversions, it's (nearly?) the most favored -- but if the alternative is no conversion, it still loses.
@LuchianGrigore Looking at this example, I think what it's showing is exactly what's expected. The difference between direct initialization and copy initialization comes when there's a conversion involved. In that case, what (theoretically) happens is that with direct initialization, the initializer is passed directly to the conversion constructor of the object being created. With copy initialization, that's passed to create a temporary, then the target object is copy constructed from the temporary.
In real life, that copy never actually happens though, and most compilers don't even check for availability of the copy ctor, though they're theoretically required to.
 
@JerryCoffin that wasn't my confusion. My confusion stems from Als' comment, where he said that a conversion operator might be preferred in copy initialization.
In the context of my examples, where I used only 1 class.
 
7:50 AM
@LuchianGrigore Yeah -- my guess is that he was just in a hurry and didn't read carefully enough. Given source and destination of the same type, I can't see how a conversion constructor (or operator) could get involved.
 
ok
maybe he'll come back to it, but I think that's it
Thanks @Jerry
 
Oh hey, that 100,000 emails question got undeleted.
 
@LuchianGrigore Surely. Should probably add on more little detail though: he's semi-right about one thing: it is possible to get copying done by something other than a copy constructor (e.g., if you have a member template constructor) -- see @Johannes' question showing it, if you haven't read it already.
@Mysticial Oh, goody! I've just been waiting to give a perfectly straight answer to that one... :-)
 
@JerryCoffin it appears a lot of comments were deleted (or am I just tired?)
meh
seems like a corner-case to me
 
@LuchianGrigore There's ~25 each for the question and answer now, which seems like it might be on the low side, but I don't remember how many there were.
 
7:59 AM
3
Q: int a = 0 and int a(0) differences

Psycho DonutI just started to learn C++. To initialize a variable with a value, I came across int a = 0; and int a(0); This confuses me a lot. May I know what is the best way?

^^ lol... denied
 
@LuchianGrigore Of course it is -- but kind of a fun one anyway.
 
@Mysticial laugh while you're still #4
f*****g markup
 
@LuchianGrigore Not unless I overtake Jerry before you beat me. :P
Dammit. I'm overdue for another big one... :P
 
@Mysticial Hmmm....do I need to start answering more questions again?
 
That'd be interesting. Place your bets - which will happen first?
 
8:04 AM
8.8, 9.3, and 9.8
500 between each.
 
@Mysticial Let's say, purely hypothetical, that you start getting downvotes. Does the number go down then?
 
@LuchianGrigore Yes
And if something gets wiki'ed the whole post is deducted from it.
 
@Mysticial If I were doing to bet, it would probably be on Luchian.
 
@JerryCoffin Same, unless I hit another lucky one.
 
8:10 AM
The real question is how long until somebody overtakes me on total rep. I've been sitting at the same rank in total rep for quite a while now...
 
@JerryCoffin litb already has more rep, no?
 
@LuchianGrigore Yup -- he's like 180K, if memory serves.
 
@LuchianGrigore He gets a lot of passive rep though.
 
25 secs ago, by Mysticial
@LuchianGrigore He gets a lot of passive rep though.
says Mysticial....
 
@LuchianGrigore Hey, there's a lot of people who get more passive rep than me.
 
8:12 AM
@Mysticial He's also stated quite directly (here in chat) that he uses sock-puppet accounts (though with him, you never know whether it's fact or troll).
 
We're all puppets of litb :(
 
I don't think there's anyone beside Jon Skeet who consistently repcaps from passive rep.
^^ That query will show how much passive rep someone gets.
 
"Total passive reputation gained from old posts Reputation gained in the first 15 days of post is ignored; all reputation after that is considered passive reputation. Post must be at least 60 Days old." lolwut
 
However, it doesn't take into account for "late game" linking.
I've had 3 posts that gained a significant number of "late-game" linking votes. So my number is severely inflated.
 
It says I make 3.4 passive rep per day
 
8:17 AM
Jon Skeet: 534.3162516869578
That's pretty accurate, since he rarely ever gets late-game linked.
 
28.23
@Mysticial u?
 
Mysticial makes 220.9
 
@Pubby Which I mentioned is inflated because of late-game linking.
BalusC: 280.38979434596143
woah
That query would be better if included the repcap.
 
@Mysticial Would certainly bring your number down quite a bit anyway.
 
@JerryCoffin Definitely, I've gotten more than 1000 votes from late-game linking.
 
sbi
8:24 AM
25.5/d here.
Good morning.
 
evening
 
sbi
Oops, @Jerry, watcha doing here?
 
@sbi Hello. Hmm...must be my bedtime.
 
sbi
Hush, off to bed with you!
 
@sbi G'night all! :-)
 
8:25 AM
night
 
sbi
Oh, now I chased him away. :( 'twas just a joke, @Jerry!
 
0.9
@sbi have you been to the careers thingy?
 
@JerryCoffin Bye
 
sbi
@Xeo Nah, I am sure the yellowjacket is much older.
@bamboon See here.
 
Alex Martelli: 107.68038718002809
seen Nov 23 '10 at 22:13
 
8:27 AM
@sbi His profile says he's 48
 
damn...
 
sbi
@Pubby You won't trick me with that old trick.
 
@sbi I am too young to know what that old trick is
 
sbi
@Pubby I am tool old to fall for it.
@sehe Yeah, I saw that, too. I might have fallen for it, if it hadn't been for the 80s picture, and the fact that he follows so many users with Flemish names...
 
@sbi oh ok
why did I miss that push conference, lame.
 
8:31 AM
I'm off too, g'night/morning/lunch/whatever applis
 
night
getting late here too
 
sbi
@Mysticial That's called C+-, though.
 
@sbi I thought the term "Clean C" was standard?
3
Q: What is "Clean C" and how does it differ from standard C?

AlanGameWhat are the differences between pure C and C in C++? And I want to know some details about 'Clean C' on which Lua is based. Does anyone know these features?

 
I thought Clean was this thing:
In computer science, Clean is a general-purpose purely functional computer programming language. Features The language Clean first appeared in 1987 and is still being further developed. It shares many properties with Haskell: referential transparency, list comprehension, guards, garbage collection, higher order functions and currying and lazy evaluation. An integrated development environment (IDE) is included in the Clean distribution. Clean's method for dealing with mutable state and I/O is done through a uniqueness typing system, in contrast to Haskell's use of monads. "The uniquene...
 
sbi
@Mysticial It might be in C circles.
Here, it's looked down upon.
 
8:35 AM
:)
 
You could call it "lobotomized C++"
 
sbi
@Pubby If you still think so, you might want to consult your Significant Other. I bet she has very different opinions on what clean is all about.
 
@Pubby Dealing with the aftermath of such a library, I prefer the name "abomination".
 
sbi
Well, I got work to do, folks.
Bye!
 
cya
 
@Pubby nice, didn't know that part
 

« first day (782 days earlier)      last day (4152 days later) »