« first day (517 days earlier)      last day (4432 days later) » 

11:00 PM
ah, man
 
There, Boost to the rescue.
 
the TVTropes entry on "confusing time travel" has Git listed as an example
citing the user's ability to go back and edit history
 
@DeadMG fair enough. I wouldn't call it confusing, but I'll concede that to you :)
 
@DeadMG lol
@EtiennedeMartel There. I'm spoiled now. So, it all plays the same, except you're given three doors to pick in the end. And they all have goats. Reminds me of ME2.
 
@RMartinhoFernandes: I never got it straight. Should I specialize numeric_limits for a fixed point class?
 
11:04 PM
@MooingDuck You can't specialize numeric_limits.
 
@je4d Hoe later op de avond, hoe schooner het volk
 
@RMartinhoFernandes k. Still seems weird to me
 
@RMartinhoFernandes Yeah, but at least in ME2 you knew which choice is "good" or "bad". Now all three suck.
 
(@je4d let me know if I need to translate since I'm not sure whether I remember your nationality correctly)
 
@sehe google did a half decent job, but didn't figure out schooner
 
11:05 PM
Also, I'm very disappointed with the justification for the Reapers.
 
@sehe I've got a dutch half sister and stepmum, but I only speak a few words
 
with a single o
 
@je4d schooner ~= schoner :)
 
"The later in the evening, the cleaner the people"
lol
 
@je4d I might have picked up on that in some conversation. Don't know why.
@je4d clean would be ~ nice
@ScottW Go right ahead. I'm working though
 
11:07 PM
I got a bit worried about this room when I logged on
it wasn't on the top row of chat rooms
 
Oh noes, gibberish.
 
@ScottW are you dutch too, or just faking it?
hmm, you profile says Michigan. Last I checked, that wasn't in holland.
 
@je4d you should check again to make sure
 
Ahoy, mateys.
 
11:14 PM
@Maxpm hi there
 
ah curses. This proprietary language doesn't have nested if statements nor no quick-bail on logical and. I can't do if (exists(string1) and strlen(string1)>0) or it returns an error.
 
@sehe We're programmers. Fixing our own problems is kind of our thing.
@MooingDuck There are so many things wrong with that.
 
@Maxpm I second the motion
 
@MooingDuck And now you know why I hate "null everywhere" kind of languages.
 
@ScottW programmeurs*
 
11:18 PM
- Why are you using a proprietary language?
- Why doesn't it support nested `if`s?
Dammit Markdown.
 
@Maxpm it's an interpreted language my company made (some 20+ years ago), to allow customers to customize bits. They don't want to to replace it or the customers will have to change all their stuff.
 
can someone tell me why static member variables are concedered declaration and need to be defined ?
 
Though I keep extending the language when my bosses aren't looking
 
@AlexDan I don't think there's a better answer than "because".
You just have to live with it.
 
@AlexDan Translation Units
 
11:20 PM
@ScottW the verb is programmeren yes
 
@MooingDuck Like an Emacs Lisp sort of thing?
 
@AlexDan each variable has to be in one and only one Translation Unit, which means it can't be in the header
 
@MooingDuck Not really. Here's proof: template <typename> class foo { static qux bar; };
 
@ScottW Are you Dutch?
 
@Maxpm like a college dropout's "my first interpreted language"
@RMartinhoFernandes integer types are magic
 
11:22 PM
Cool!
 
@MooingDuck It's not about the int.
 
@RMartinhoFernandes did C++11 change that?
 
Wait, static variables have to be defined? That's a little non-C++-ish.
 
@Maxpm Huh? How so?
 
struct Foo
{
    static int bar; // Illegal?
}; // I hate this freaking semicolon.
 
11:23 PM
Yeah, no ;.
 
@Maxpm in C++03, integers were special cases, as long as you never took their address.
 
@sehe Well, I can do int foo in the middle of a function and get undefined behavior if I try to access it. Why not with static int foo in a class?
 
All externally visible entities need definitions, so they get emitted in the proper TU
@Maxpm Because the class members are externally visible (have linkage)
 
@sehe Aah. Interesting.
But why does external visibility necessitate that the variable be initialized?
 
You can use the class members from a different TU. The compiler needs to know when and where to initialize them.
@Maxpm It doesn't. Only for const statics
 
11:25 PM
@Maxpm not initialized needs definition
 
@MooingDuck I'm not sure what the difference is.
 
Start at the top :)
2
 
@Maxpm definition means "it now has an address: it exists". delcaration means "it will exist later". initialization means "it has a value"
 
@sehe lol
 
You're saying that things like, say, extern "C" static int bar; are illegal?
 
11:26 PM
@MooingDuck damn, got there before me
 
@Maxpm that's a declaration (if it's a member). It also needs a definition somewhere.
 
@MooingDuck : and why just static member variable who get just declared in class and defined outside, so if they get defined inside class they will break the one definiion rule, can you tell me why ?
 
@MooingDuck not "it will exist later" but "it exists somewhere" (the name exists)
 
@sehe eh, I was thinking from the compiler's standpoint. But yeah, that's more accurate
 
@AlexDan Because. Those are the rules.
C++ can already deal with duplicate definitions in multiple TUs, but for this particular case, it doesn't.
 
11:28 PM
@AlexDan if it's in a header thats included in two files, that means both of those files will create that static, which violates the "One Definition Rule"
 
@MooingDuck It is a member. So, then, it would be illegal because it's publicly visible without a definition?
 
You can claim they're stupid rules, but well, this is how C++ works.
 
@RMartinhoFernandes duplicate definitions? duplicate declarations, ok. Duplicate definitions can be troublesome unless (even if?) inlined?
 
@Maxpm yes (with the exceptions of magical integer types)
@sehe templates have magic there
 
@MooingDuck Integral types default to zero?
 
11:29 PM
@MooingDuck true
 
@Maxpm no. If a class has a static int special = 4; and never grabs the address of that, the compiler doesn't care if it was ever defined. But that's a special case for integer types. Because it knows what 4 is, and all 4s are equal, so it ignores the lack of definition.
 
@MooingDuck Why doesn't the same apply to floating-point types?
 
@Maxpm because floating types are different from machine to machine. An int is the same (more or less) on all C++ implementations.
 
Also, static int special = 4 looks like a declaration, definition and initialization to me.
 
11:32 PM
@RMartinhoFernandes ok, templates
 
@Maxpm There's no rhyme or reason to this. It's all because of ugly historical artifacts and crazy architectures.
 
@Maxpm it is a declaration and initialization, but if it's a member, it's not a definition.
The magic of the int is also why it is the only type that can be initialized at the declaration. No other type can do that. (well, short, char, long)
 
@sehe Right, and there's no technical reason why the same can't happen for a non-template.
 
@MooingDuck Did you mean to say, "it's not a definition?"
 
It's just historical.
 
11:33 PM
@Maxpm yes, thanks.
@RMartinhoFernandes I can't believe I've gone this long and haven't said something stupid enough for you to say "no wait, that's wrong"
 
Why isn't special defined if it is a member (a static one, no less)?
 
Because. I've said this three times now.
 
@MooingDuck If it's a member, and therefore not a definition, I'd have thought that it couldn't be an initialization (else you could have multiple declarations with different initialization values)
 
@Maxpm because if two files included that same header, both files would have that global variable allocated in them. Thus there would be 2+ instances of that global, which doesn't make sense. (there's ways to fix that, but the rule stands)
@je4d only integer types can be initialized there, and their "magic rules" specify something to address that (same initialization, or only one initialized or something, I don't recall exactly)
 
11:39 PM
@MooingDuck Ah, I see! So when is special finally defined?
 
@Maxpm wherever you have the line membertype myclass::special; (hopefully in a .cpp file somewhere, and not in a header) or else you get linker errors
 
@MooingDuck actually, if it's a member I guess you can only have one declaration in any one TU, so it'd just take the initialization value from the declaration that was in the same TU as the definition
 
@ what I meant is why the compiler considere it just a declaration not a definition ( like non static member variable)
 
@je4d you can declare a variable as many times as you want
 
@MooingDuck I'm not sure what you mean by membertype.
 
11:41 PM
@AlexDan what is the address of that global variable
@Maxpm typeof(special) (did I say it was an int or something? I can't recall)
 
@MooingDuck I was talking about a static member variable - you can't redeclare that
 
@MooingDuck You said int.
I think I understand.
 
@je4d I don't recall if you can or not now that you mention it. But one could attempt to give it another value at the definition
@Maxpm so int myclass::special;
 
@MooingDuck You can't. You can only declare them in a class definition.
Redeclaring it would imply redefining the class.
 
@RMartinhoFernandes can't do extern int myclass::special;? I can't imagine why one would, but alright.
 
11:43 PM
@RMartinhoFernandes yeah, that's where i was coming from
@MooingDuck true. I wouldn't like to guess what happens if you try to give it another value at the definition
 
@je4d I'm pretty sure a compiler error (I know it's against the rule, I hope there's an error)
 
@MooingDuck No. And if anyone is planning on asking "why?", the answer is "Because." again.
 
@MooingDuck That'd be the best response
 
§ 9.4.2 has all this information, in the C++11 draft: open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf
"The declaration of a static data member in its class definition is not a definition and may be of an incomplete type other than cv-qualified void. The definition for a static data member shall appear in a namespace scope enclosing the member’s class definition."
"There shall be exactly one definition of a static data member that is odr-used (3.2) in a program; no diagnostic is required."
 
Hello
 
11:48 PM
Hold on. Since headers are just copied into .cpp files, the first .cpp that #includes it would look like this to the compiler:
struct Foo
{
    static int special = 4;
}

// And then the actual code that included Foo....
 
ooh! "A static data member of literal type can be declared in the class definition with the constexpr specifier;if so, its declaration shall specify a brace-or-equal-initializer in which every initializer-clause that is an assignment-expression is a constant expression. The member shall still be defined in a namespace scope if it is odrused (3.2) in the program and the namespace scope definition shall not contain an initializer."
@Maxpm right, that's why the static can't be defined in the header, only declared, (and sometimes initialized)
 
@Maxpm All .cpps that include it, not just the first.
 
@MooingDuck But, assuming the Foo header is #include-guarded, subsequent source files just see that original copy-paste job.
 
@Maxpm that's c++11 specific
 
Apperently for C++11 they removed the "integer" magic, and made it "constexpr" instead. Also, you can't initialize the definition
 
11:50 PM
@Maxpm Nope, #include guards prevent reinclusion in the same TU.
 
@Maxpm nope, the include guard is per CPP file, so that each CPP gets each include ones. Every CPP/Translation Unit gets the full header
 
Okay. So if I did this:
 
@MooingDuck makes sense, it wouldn't be much use as a constexpr if its value wasn't available at the declaration
 
@Maxpm taps foot
 
g++ -c -o First.o FirstFooUser.cpp # Includes Foo.h.
g++ -c -o Second.o SecondFooUser.cpp
 
11:52 PM
@Maxpm each .cpp gets all of Foo.h once and only once.
 
I would not be able to link First.o and Second.o because an essentially-global variable is never given an address?
 
//FirstFooUser.cpp
#include "Foo.h"
#include "Foo.h" <-- include guard makes this do nothing
#include "Foo.h" <-- include guard makes this do nothing
#include "Foo.h" <-- include guard makes this do nothing
 
@Maxpm try running cpp FirstFooUser.cpp to see what goes into the compiler after the #include expansion
 
@Maxpm if the global was not defined in either .cpp, then correct
 
11:54 PM
Ok, you fixed it.
 
hey
enter password to unlock private key git
what is private key
it's locked
?
 
> The problem with the world is that the intelligent people are full of doubts, while the stupid ones are full of confidence.
 
@RMartinhoFernandes I'd misunderstood for a moment
 
@hey it's the passphrase you chose when using ssh-key-gen
 
@Maxpm It would fail to link if something actually used it, otherwise the absence of a definition would not be a problem
 
11:54 PM
@hey that's what keys are for yes
 
hey
@sehe: where can I find it I can't understand
I have ssh key
 
@EtiennedeMartel I wouldn't call that a problem. It makes it easy to pick out the stupid people, and the smart people can have worthwhile discussions with each other.
 
@hey you can. You just don't yet. You can't find the password. You must know it
 
@je4d er, yes. I think technically it's wrong, but I don't think any compiler would care.
 
hey
(12:7d:73:...ba:26:ec:e4:c3)
 
11:55 PM
@hey facepalm
 
@je4d Would it fail to link if nothing used it, but it were an std::string instead of an int?
 
@hey that's the fingerprint
 
@MooingDuck No, it's okay. You can declare as much as you want without defining.
 
hey
is it password of my account?
 
@hey no, it's the key fingerprint
 
11:56 PM
@RMartinhoFernandes if you say so
 
@Maxpm I would expect it to still link regardless of type if it was undefined and unused
 
@RMartinhoFernandes static int special; static int special; static int special; is legal?
 
@MooingDuck these sentences to @hey are messing with my brain
i keep on reading them as e.g. "hey, facepalm!"
 
@Maxpm I don't think you can declare a member multiple times, but if it were a global (with extern) then yes
 
extern int mike_is_stupid; // put this in all source files!
// and replace "mike" with appropriate cow-worker's name
// and "stupid" with appropriate insult
 
11:58 PM
@je4d yeah, I wish it put a colon or comma after the name
 
Aha.
 
@Maxpm in what scope?
 
@je4d As a public member.
 
@Maxpm I'm pretty sure you can't do that for static members
 
I can never quite recall what putting static on a global variable means :/ Isn't that "not accessable outside this TU"?
 

« first day (517 days earlier)      last day (4432 days later) »