« first day (921 days earlier)      last day (4044 days later) » 

11:00 AM
@R.MartinhoFernandes URL?
 
@Telkitty I am a pussy, no need to curse me for that :)
 
@R.MartinhoFernandes wanna some downvotes?
 
Answer looks good. Have a vote.
 
^ this
 
user1357851
I am gathering something to eat, I am hungry, please show more love towards the chick in my avatar.
 
11:01 AM
@R.MartinhoFernandes Have 'nother.
 
See, this works.
 
Bobince's is better, btw.
 
For the record, I also upvoted the other answer and downvoted the question.
 
Also, now I don't need to post more Python answers! Yay!
 
@LightnessRacesinOrbit what?
 
11:02 AM
@TonyTheLion Good question!
Actually, the question isn't that bad I suppose
 
@Telkitty "gathering something to eat" sounds like you're going hunting.
 
@TonyTheLion Well, she does look like a predator.
 
user1357851
yes, fear me!
 
@DomagojPandža lol
 
user1357851
better to be a predator than a prey
 
11:04 AM
true
 
I prefer to shoot both.
 
Breaking news: voting ring discovered in C++ chatroom.
 
user1357851
I need some food, I am depressed, I think I made more enemy in real life today :'(
 
Hi, I've a small question (on static member variables in c++). May i ask here?
 
@ustulation no
 
11:07 AM
@ustulation There's no rule against it, but why would you? It seems like a strange thing to do
 
@ustulation Is it a question that will never help anyone? Because if it can help someone, it should go on the part of the site where people in need of help search for things: stackoverflow.com/questions/ask
 
Given that you obviously know that this is a chat room intended for goofing around and slacking and arguing, whereas stackoverflow.com is the biggest site in the world for programming questinos
 
Oh Sorry! I'll do that. I thought it being a very small query, would not be worth asking in the usual SO questions page
 
@ustulation Okay.
 
0
Q: multi_index_container removing last element

user2301299I have following definition: typedef boost::multi_index_container< boost::shared_ptr<Temp>, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::const_mem_fun<Temp, unsigned int, &Temp::getParam> > > > RequestsContainer; I need to remove (...

for the repwhores who understand boost::multi_index_container
you're welcome :)
 
11:10 AM
@ustulation It is possible that that is true. What you can do is ask here and, if it turns out to be an interesting question, then later post it and self-answer it so that other people can share and delight in your new knowledge!
 
@ustulation Don't forget to search.
 
Seriously, we could have answered it by now. Instead of engaging in all of this wankery.
 
:) ok, since c++ 11 allows in class initialization, are we still required to define static member variables in .cpp files?
 
@LightnessRacesinOrbit We're master wankers, of all types and kind, you should know that by now. :P
 
11:11 AM
@TonyTheLion Oh I'm aware
 
Xeo
@ustulation ya. Those are completely unrelated things
 
@ustulation I believe, technically, yes! Let me check.
 
@ustulation even in C++03 you could define'em in .hpp is it's a template class
 
Xeo
in-class initialization of non-static members is basically a shorthand for putting that initializer in every ctor.
 
There has been no relaxation on static members with respect to declaration, definition and initializers. Has there?
 
11:13 AM
3
A: Initialize a static const non-integral data member of a class

Mike Seymour Is Line1 doing the initialization of the date member data? It certainly is, as well as providing the definition of the object. Note that this can only be done in a single translation unit, so if the class definition is in a header file, then this should be in a source file. Is Line1 the ...

> In C++11, any static member of const literal type can have an initialiser in the class definition. You still need a definition of the member if it's "odr-used" (roughly speaking, if you do anything that needs its address, not just its value). In this case, the definition again needs to be in a single translation unit, and must not have an initialiser (since there's already one in the class definition).
 
I recall looking that up at one time, but not what I found out.
 
As you can see, there is no need to re-post this question.
 
shit that answer is incomplete.
 
> [C++11: 9.4.2/3]: If a non-volatile const static data member is of integral or enumeration type, its declaration in the class definition can specify a brace-or-equal-initializer in which every initializer-clause that is an assignment-expression is a
 
Yeah needs constexpr. No relaxation that I can notice.
 
11:17 AM
> [..] constant expression (5.19). 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.
> [..] [ Note: In both these cases, the member may appear in constant expressions. —end note ] The member shall still be defined in a namespace scope if it is odr-used (3.2) in the program and the namespace scope definition shall not contain an initializer.
 
Xeo
Told ya so
 
Ok. Thank you all so much. @Lightness: I did go through some of the answers but none of them specifically mentioned about C++11 so i thought they must be old rules. In hurry i missed to read answers thoroughly.
 
huh, 9.4.2 doesn't talk about non-const static members. I thought these could be initialised inline now?
 
I'm still leaning on the 'no relaxation' side here.
 
well yeah I see no new rules here
the rules for static member initialisation look just the same as in C++03
 
11:23 AM
we are surrounded with technological marvels
 
so why couldn't C++03 have the static const member initialized in the class definition>
 
because fuck you, that's why
prolly the same reason C++11 doesn't have make_unique
anyway global static definitions are retarded as hell
to be honest, when I code in Java, I am not concerned with shit like this
 
Xeo
@TonyTheLion we still can't have that for non-integral types
 
almost every convenience feature I want to use, I'm like "oh in C++ it doesn't work, but I bet'cha Java has it" and it's true
 
Xeo
That's a bold claim
 
11:27 AM
> convenience feature I want to use
 
ok so besides Mr Barket's rant, is there an actual technical reason for it?
 
Ah, I found this question posed on SO already:
0
Q: Do we still need to separately define static members, even if they are initialised inside the class definition?

Lightness Races in OrbitIn C++03, we had the ability to initialize const static class data members inline within the class definition, but still had to define the member if it were to be odr-used. Is this still the case in C++11? struct Foo { static const int x = 3; }; const int Foo::x; // ^ required?

@TonyTheLion It could.
 
I am not writing complicated shit in Java, but that's not what this language is for. It's for dumb, technically dumb, logically dumb and dumb simple solutions
 
struct Foo { static const int x = 3; }; // nothing wrong with this in C++03
const int Foo::x; // just don't forget this if you're gonna odr-use `Foo::x`
 
so every medium-rare steak student can learn and understand it
 
11:29 AM
@BartekBanachewicz The odorless, biodegradable, safe, simple (?) language.
 
it is simple
if you keep yourself to the constantly repating patterns and solutions, and just intermix them, the language is good.
it's just a crude hammer.
compared to php's hammer.
 
@LightnessRacesinOrbit Right, but I'm more wondering what the technical reason is why this isn't acceptable?. If there is such a reason, maybe its just because it was inconvenient to implement.
 
@TonyTheLion Dumb compilation model rules, that's what.
 
ah I see
 
@TonyTheLion Complex construction most likely
i.e. what you said
 
11:33 AM
hmmm interesting
 
Xeo
@TonyTheLion when would that thing be initialized?
where would its address be?
 
somewhere
 
Xeo
...
 
why should a programmer care about that exactly?
 
11:35 AM
^ Why should it ever matter?
 
Xeo
How should the compiler / linker possibly know exactly?
 
@Xeo when the ctor is called?
 
Xeo
@ThePhD how do you access a variable in machine code?
@TonyTheLion When is that done?
Or do you mean the ctor of foo?
foo::stconst // mah, no ctor
 
@Xeo I mean that
when foo is constructed
 
@Xeo At the start of the program, like every other const static variable.
 
11:36 AM
I'd go for "at first access"
 
Xeo
@ThePhD void foo(){ static const std::string str = "foo"; }
 
but I guess that violates static
 
here come the downvotes
 
dowvotes.gif
 
there are probably a million reasons why it is bad, but...
 
Xeo
11:36 AM
still doesn't solve the problem of where the address is
 
@Xeo Okay, every other const static variable not scoped in a function.
Happy now? :c
 
i don't have the slightest idea of how static function variables are implemented
 
Xeo
@ThePhD static const int x = 4; // look mah, initialized *at compile-time*
 
but they did it somehow
so I figure that this is possible for types too
 
user1357851
I need an hour jogging today ... ate 2 much :(
 
11:38 AM
@Xeo Not from the perspective of the language.
 
@Xeo static const std::string x = "Wee"; // Not initialized at compile time, but before we enter the written main
 
@Xeo optimisations don't count
@Xeo define "compile-time"
 
Xeo
@ThePhD where is the address?
@LightnessRacesinOrbit Where is there an optimization?
 
@BartekBanachewicz And for those it's too complex?
 
@Xeo In the supplanting of every reference to x with 4 during compilation.
 
11:39 AM
@R.MartinhoFernandes um, no. I am quite happy with Java thus far.
 
@Xeo The address is where any other variable's address would go. Preferably in the pre-initialized block of memory for const static members bumped up by crt0 .
 
Xeo
@LightnessRacesinOrbit That is not an optimization?
 
The language does not even have a "compile-time".
 
C++ users have a "miserable-time" though.
3
 
11:41 AM
lol
 
Xeo
@ThePhD foo.cpp includes stconst.h, bar.cpp includes stconst.h, and both are seperately compiled - now link foo.o and bar.o
 
2.2. defines phases of translation and none of them include substituting static const variables for their initialised values.
 
@Xeo Which is why my initial answer to Tony's question was "Dumb Compilation Model"
 
Xeo
@R.MartinhoFernandes what
 
11:41 AM
The as-if rule lets the compiler do it in some cases. That's called "optimisation".
 
Xeo
> 20.10 Compile-time rational arithmetic [ratio]
 
@Xeo That's a label.
 
That's the library, too.
 
Xeo
> X::int_type (described in 21.2.2) compile-time
 
The Compilation Model fucks this up. Not anything else in the language itself.
 
Xeo
11:42 AM
Complexity ^
 
@R.MartinhoFernandes To be fair, it is yet another example of the committee totally fucking up C++'s abstractions, in C++11
 
In Hell++ only the library has a compile time!
 
"oh but everybody compiles C++"
 
therefore missing the point entirely. twats.
 
11:42 AM
Guys, I can't handle the cute. :(
 
@DomagojPandža Go to sleep.
 
@Xeo And that one is not defined anywhere.
(Needs a DR)
 
in fact, I'd go so far as to suggest that the label of [ratio] is a defect
who wants to pick that one up? I'm not on any of the pertinent mailing lists
 
Should be "Meta-programming rational arithmetic" or "Type-based rational arithmetic".
 
yes
actually, can you tell me how to report a defect? I'd like to get one in my name, after Wakely stole cplusplus.github.io/LWG/lwg-active.html#2231
 
11:44 AM
lol
 
Xeo
Hm, somehow my message isn't showing up on std-proposals
 
Proposal: remove-erase C++ off the face of the Earth.
 
Xeo
But I already received a reply to one of them
 
11:46 AM
@ThePhD You still awake? :D
 
@Xeo maybe you accidentally replied to person not to list
 
@DomagojPandža Hellz yeah.
I killed a lady with a spider for a vagina and legs 21 times
 
@R.MartinhoFernandes What does it mean that translation-time floating point ops may yield a different result than runtime ops?
 
And I killed a giant iron golem 3 times
 
@ThePhD what?
 
11:47 AM
and a huge dragon who's ribs were its teeth and its mouth was its whole body 2 times
 
@TonyTheLion Probability assessment suggests a violent game. :D
 
I also am struggling with my thread pool on how to pass in some of these variables to the thread
 
two downvotes :( it makes me so sad
 
3...2...1...
 
11:47 AM
I think I'll just capture the whole thing
 
Yeah, downvotes are hurts. It's not about the rep, someone doesn't apprich you(r answer). :(
 
also, where's @kbok
 
Xeo
Hm.. does "reply to author" not entail a post on the mailing-list itself? :s
 
@Xeo Not on some lists I use. The reply-to is often the author, not the list.
 
11:48 AM
@LucDanton That's a note :P
 
Xeo
Damn
 
user1357851
Anyone volunteer to be the victim to the chick in my avatar?
 
@ThePhD Seems a bit... Raw. :D An old school game?
 
@R.MartinhoFernandes Sure. Still a worthy question, no?
 
@Xeo My email client presents a separate "reply to list" button in such cases, using the List-Post MIME header (I guess)
 
11:49 AM
@DomagojPandža The wiki is raw. The game itself is a bit on the older side with a sequeal in the works.
 
struct PTS<T U::*> wat
 
That's one wonky member function pointer.
 
Xeo
pointer-to-member.
Either member function or member data
 
@LucDanton It means that floating-point on the translating system may not be the same as floating-point on the execution system.
 
I have gone into unexplored internet lands if I find stuff like this
 
Xeo
11:51 AM
lol "unexplored"
template<class R, class T> unspecified mem_fn(R T::*) :D
 
@ThePhD From 2011, I believe? Not what I'd consider particularly old
 
you are going to hell for that
 
Xeo
@BartekBanachewicz 20.8.10
 
I think there's a subreddit for that
 
I am wondering how to partially specialize our function_wrapper_impl for void and tuple returns
 
11:52 AM
@jalf 2010? I think. I dunno. :D
q_q Nobody is summoning me anymore.
Everyone is being boring and has gone to bed.
What a bunch of sticks in the mud.
 
@LightnessRacesinOrbit k, so does that mean C++ has no compile-time because a conforming implementation can choose to emulate the floating-point ops and environment of the host on the target?
If not, then what is or what would be the difference between translation and a (possibly hypothetical) compile-time?
 
user1357851
hacking groups are real or not
 
@LucDanton Yes!
 
@DomagojPandža That's one heavily decorated sleeve
 
11:56 AM
nananana
> char is neither a signed integer type nor an unsigned integer type
 
@BartekBanachewicz ._.
 
I know that's a repost, but so funny
 
The standard is absurd.
 
@LucDanton Translation does not require a target language, merely an internal representation. Compilation implies a target language and a real computer.
That is, translation is more like "interpretation".
 
Guys, quick question.
TWork work = std::move( threadwork[ index ].Pop() );
^ is std::move necessary?
 
11:57 AM
I uh don't compile most of my programs to a language. I think?
 
E.g., will the temporary TWork from Pop move automatically into work ?
 
@ThePhD We shall call it The Absurd.
 
> [C++11: 2.2/9]: [..] All such translator output is collected into a program image which contains information needed for execution in its execution environment.
I think that's as close as you get to "compilation".
@ThePhD who the fuck knows. move sucks
 
Meh, whatever. Can't hurt to have it.
 
it's completely unintuitive
 
11:59 AM
But it allows implementations to be funky at e.g. loading time!
 
user1357851
I went to uni with people who sold, founded multi-million dollar business, I worked with algo traders who's bonus worth half a million a year or more I saw beggars on the street, I know accountants, software developers, quants, teachers, cleaners, buliders, brokers, sales people, handyman, but I have never met an accomplished hacker in real life, ever!
 
Xeo
@ThePhD Does Pop return by-value?
 
@Xeo Yes
 

« first day (921 days earlier)      last day (4044 days later) »