« first day (842 days earlier)      last day (4328 days later) » 

13:00
That part of the API is full of macros apparently.
Erm. Surely this is RTFM material (still bad API experience of course)
@DeadMG it is if the object is const, at least
could a semaphore and a condition variable essentially be considered the same thing?
@LightnessRacesinOrbit this is non-const during the construction of a const object.
@sehe The fine manual says "U_GC_XX_MASK constants are bit flags corresponding to Unicode general category values." and "u_charType: Returns the general category value for the code point."
13:05
fucking fuck software portal Y U only version of ICC 7.0. Dammit, was it made on 486 or wat?
I love how fucking hard is to get our own products
It's easier to get a classified hw prototype than to download a compiler
Xeo
Xeo
lol
Oh, it seems I've found it
> By requesting a license for these products, you are acknowledging that these products will only be used for internal or personal (home) use
Post a link here.
@BartekBanachewicz You work at Intel?
Xeo
Xeo
13:09
Damn it, I don't have any drinks with me today. ;_; No food, no drinks... and 4 hours to go.
@R.MartinhoFernandes even if I did, it wouldn't work for you. All inner links are domain-shit authorized.
@BartekBanachewicz I meant, a magnet link.
metalink
man
magnets take for fucking ever to load.
13:11
@Xeo Can't you just go out and buy something?
.torrent download direct is way faster
@DeadMG Never noticed it.
@DeadMG What
Xeo
Xeo
@DeadMG Eh, not for me.
ITT puppy sucks at torrents.
Xeo
Xeo
13:11
@R.MartinhoFernandes The super market is so far away~ :(
he just meant the time to download .torrent file
because that's basically what magnet links are for
0
Q: Using for loop with #define

ProgrammerIn order to speed up my code writing, I am trying to define for loop using #define as follows: #define rep(i,a,b) for(i = a, a<b;i++) using namespace std; int main(){ rep(i,0,5){ cout<<"It works"; } return 0; } However, the code is not compiling. what am i doing wrong h...

Fire.
FIIIIRE:
flag / comment / answer?
Anyway, damn SO. "Would you like to move this discussion to chat?" sure. "LOL NOPE the noob only has 1 rep LOLOLOLO"
Xeo
Xeo
13:13
@LightnessRacesinOrbit Still missing the type for the loop counter.
@Xeo Already added that in
I'd love to know who the guy is that up voted this answer.
@Jeffrey why why why bring a PHP question into this room????
do you want to die???
We don't why are you linking PHP questions here
13:15
Dammit, I can't find a suitable nickel character.
You are the only friends I've ever got :(
Xeo
Xeo
@StackedCrooked lol
well, then don't link PHP questions in here
I had to go with U+1F4B0 MONEY BAG, which isn't quite a nickel.
13:15
Stop doing PHP
@R.MartinhoFernandes 2 dimes?
@StackedCrooked Pi day already?
Anyway the answer is really not PHP related and it's funny, I promise...
@Jeffrey Muhahahaha. The misconception
@R.MartinhoFernandes the guy calls himself Programmer <facepalm>
13:17
No one has friends on the Internet :P
@BartekBanachewicz They used to check for this, IIRC
@TonyTheLion No one on the internet has friends, FTFY
@sehe I'm going with this on meta
Yay. Purpose In Life!
@TonyTheLion, I do, and that's you ;)
13:19
@Jeffrey awww :)
Ok, that was weird...
I've gone too far this time...
I was trying to be nice
for once
I'm not generally a nice person, but I have my moments. :P
13:21
struct X
{
X(A a);
enum A {x};
};
why do you have to define the enum before you use it in a class definition?
Ouch, all that sweetness in my blood stream: it's killing me.
@LightnessRacesinOrbit You're wrong.
@DeadMG That's very helpful
a pointer to the Derived is not the operand of the static_cast, it's the result of the static_cast.
@DeadMG I'm looking for opinion based on facts!
2
13:22
so the fourth bullet does not apply.
mike seymour has it
@DeadMG Why? The operand is this, and "any pointer that refers to the storage location where the object will be or was located" includes any pointer to that object
@LightnessRacesinOrbit "For an object under construction or destruction, see 12.7. Otherwise, (...)"
l2see12.7
@R.MartinhoFernandes You reckon the entire rest of the paragraph only applies to objects not under construction or destruction?
Xeo
Xeo
@LuchianGrigore Same as always, the class is only considered fully defined in the body of a member function.
What does that even mean anyway
13:24
@LightnessRacesinOrbit Yes.
@R.MartinhoFernandes I disagree. Were that true, the whole trailing section of the passage talks about dereferencing a void*, which is meaningless
I think only the sentence beginning "Otherwise" is pertinent to that conditional logic
What follows cannot possibly be, because dereferencing a void* is impossible
I think @LightnessRacesinOrbit has it right. The complete object is still under construction, and this refers the location where it will be constructed. Thus, you can't give that pointer in input to static_cast
@AndyProwl It doesn't refer to that location. It will be constructed in a (very slightly different) location.
13:29
@DeadMG Really?
@LightnessRacesinOrbit The only way they will be constructed in the same location is if EBO applies.
I think you'll find that, after construction, (Base*)ptr and (Derived*)ptr for this object are the same!
@DeadMG: Why so? The address of the full object and the address of the subobject is the same in this case, isn't it?
@LightnessRacesinOrbit Think multiple inheritance.
@LightnessRacesinOrbit Maybe not.
Eisenbahn-Bau- und Betriebsordnung the German regulation on the construction and operation of railways?
@R.MartinhoFernandes which is not in use
there is no multiple inheritance in the example
13:30
@AndyProwl No guarantees.
@DeadMG: Not in general, OK, but not even in this particular case?
and I think your definition of "refers to the storage location" may be too narrow. You're assuming it means the co-ordinates of the start of the derived sub-object and nothing else?
as I said, the only place where you might possibly find such a guarantee is EBO.
I think your reasoning about void* is wrong too.
It says that you can use it as if it was void*, but does not say it has to be void*.
the pointer clearly points to a place within the object.
13:31
@LightnessRacesinOrbit That is the location of an object, yes.
@R.MartinhoFernandes Okay, but if you're going to use it as if it were void*, then you can't dereference it.
auto p = static_cast<NonPod*>(malloc(sizeof(*p));
@DeadMG Arguably the "location" spans a region, and is not just a single address.
@LightnessRacesinOrbit I have never seen any Standard passage that treated it as such.
the location of an object is it's address.
39 mins ago, by DeadMG
@LightnessRacesinOrbit Nope, I'm not one of those Standards lawyers.
13:33
@Jeffrey does it cheer you up if I hope so?
heh
@sehe, that's mean
@DeadMG: at best, then, it's unspecified whether the pointer refers to the same storage location and, then, it is impossible to say that the semantics are well-defined for this example.
@DeadMG: EBO only deals with the size of the subobject. Even if the subobject has size > 0, it doesn't mean its address is different from the address of the full object
@Jeffrey you went to far :)
13:34
where is "far"?
@LightnessRacesinOrbit Well, I still believe that the passage doesn't even apply.
@DeadMG how come?
The "otherwise" stuff? I thought we'd dispensed with that!
mike seymour is quite correct- the Standard clearly refers to another passage for objects under construction.
@sehe, that doesn't mean I deserve to die :...(
In the example the addresses cannot be different because it is a standard layout type.
13:34
@DeadMG No, I've addressed that already.
For other types all bets are off, but not for this one.
@R.MartinhoFernandes Ah yes!
@R.MartinhoFernandes: Exactly
@R.MartinhoFernandes: so that should mean the static_cast is illegal in this case, shouldn't it?
@Jeffrey I didn't say you do
@LightnessRacesinOrbit I don't accept your argument.
13:36
@AndyProwl No idea. I am inclined to say it is.
for one
FTR: upcasting to a base that was not constructed yet is UB. (this much is made explicit in 12.7)
it's far from impossible to suggest that it's simply defective in that wording.
@DeadMG I'm sorry to hear that. It's still sound, though
@DeadMG I don't think you can base an argument on standard-defined semantics on the premise that "the standard is wrong", especially when the wording in question is in no way self-contradictory
Given that, I am ready to assume there something somewhere that makes downcasting to a non-constructed derived type UB as well.
13:37
and for two
the contents of the rest of the passage are irrelevant.
the Standard clearly says "In X condition, see Y."
@DeadMG No, I've addressed that.
@LightnessRacesinOrbit I don't buy your argument either, but I think you have the right conclusions.
@DeadMG The conditional branching extends only to two sentences. I have deduced this via clever English comprehension and stated the very good reasons for that
Me: "[...] it's killing me.", @sehe: "[...] I hope so."
of course, the important thing is that the question is attracting upvotes
13:38
lol
See example in 12.7/3.
examples are non-normative IIRC
If doing that that is UB, I doubt your example isn't.
@R.MartinhoFernandes that is upcasting though
@Jeffrey Who are you discussing this to? I do trust you know a joke. If not, apologies
13:39
@R.MartinhoFernandes I agree though that it seems to set a precedent of intent
@LightnessRacesinOrbit Which is much milder than downcasting.
@LightnessRacesinOrbit barf
@sehe, Yeah, don't worry. :)
@Jeffrey phew. I was starting to get worried. In that case, get a hobby. Reimplement PHP in C++
@sehe, that's even meaner :)
13:41
O-key, it's DLing in both here and my home.
@R.MartinhoFernandes Show example?
@sehe, I know it's actually a bad idea (mostly because of bad string manipulation), but it's not the first time that I think of doing it.
@Jeffrey and the chances of it actually killing you are even brighter that way :)
@Jeffrey string manipulation isn't bad. It's what string manipulation is being used for that is completely off the handle
@sehe, I'm not following...
13:44
lol, arrows in the standard are exclamation points with a special glyph. Fail.
@Jeffrey string manipulation is inevitable. You can't say "string manipulation" is bad
Xeo
Xeo
lawl
@R.MartinhoFernandes ahaha
@R.MartinhoFernandes which standard? Not the UNICODE standard, I presume?
@sehe, I meant that "string manipulation" in C++ is harder than most of the modern languages...
13:46
@Jeffrey Really?
@Jeffrey Is that because by "modern" you actually mean "high-level application-level scripting-esque"?
@Jeffrey Oh that way. I don't fully agree. I tend to find C++ great for expressiveness because you can mix and match algorithms and direct iterator traversal.
However, things break down famously if you need encodings and localization
@sehe C++. The Unicode Standard PDF has about a zillion embedded fonts to support everything properly.
@Jeffrey I'd disagree.
@R.MartinhoFernandes Ok (I hope they do shallow embedding :))
@Jeffrey Use Boost.StringAlgorithms.
13:49
@sehe, how would you manage C++ for the web? FastCGI?
Another music tip: Paul Gilbert - Acoustic Samurai album. Great proof that being epic on electric will translate to epic acoustic playing. Nice, smooth, yet still with virtuoso guitar hints.
@Jeffrey FCGI is pretty popular.
@BartekBanachewicz, would that be the best way?
@Jeffrey I wouldn't. Anyways, some kind of templating engine should be the minimum requirement. Perhaps klone or PoCo HTTPServerPages
@Jeffrey There's no best way. "It depends"
> Its used in production by me. Interface may still change slightly in the future. Under some conditions Vim crashes although it shouldn't. Try it and report how well it works for you.
^ instills confidence vim-addon-async
13:51
@sehe it's used in production despite it crashes unexpectedly. that
@BartekBanachewicz "by me"... lol. Webscale
@sehe I am becoming enterprise-ish. :(
@R.MartinhoFernandes The only instances of UB in that sample involve virtual inheritance, which isn't used in the original question.
@sehe, then what should I use for web development that is supported in the average of web servers? (I've already taken a look at Python and Ruby)
Django or Rails :)
Really. Do what is fit for the purpose. Favour what makes you productive.
Solved.
13:53
@DeadMG It doesn't really matter. The text does not restrict itself to that.
Upcasting to a non-constructed yet base is UB.
@Jeffrey I have used Mongrel for small web applications (like Coliru).
Django is nice.
118
A: What's the best way to trim std::string

Evan TeranI tend to use one of these 3 for my trimming needs: #include <algorithm> #include <functional> #include <cctype> #include <locale> // trim from start static inline std::string &ltrim(std::string &s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), ...

@sehe, I find Ruby on rails a pretty good framework. But how is Ruby that better compared to PHP?
Found one more UB-ish isspace.
13:54
@StackedCrooked have you found that isocpp link I posted about?
@BartekBanachewicz I found it.
It's cool.
yea :) I should've posted it at the first time, but I was writing on iPad on the bus.
@BartekBanachewicz Which?
views
give them
Yes, we know.
I enrolled in it.
I want to laugh.
@IdanK: Great, isn't it! Look at all the competing options we now have at our disposal, unencumbered by a single person's idea of "the way that we must do it"! — Lightness Races in Orbit Jan 30 at 1:40
Hah, I don't remember writing that.
@R.MartinhoFernandes Is it worth it? Amd logo and Tux pretty much make it looking like really crappy shit.
13:57
@BartekBanachewicz No fucking idea. I'm guessing: "no, it's crap", but I want to look at some actual content to laugh a bit.
Assembly keyword scared me off, but I'll appreciate some update on it, if you'll be doing something towards that.
> Exactly squared. Just knock up your own certificate in Word and print it out, it would have identical legitimacy.
Also, I wonder if the "dragon book" (book about compilers) is called that way because writing your own compiler involves fighting (unicode) dragons.

« first day (842 days earlier)      last day (4328 days later) »