« first day (305 days earlier)      last day (4869 days later) » 

12:01
There's no more "Does not belong here" flags ?
What do you mean?
@kbok what's your blog btw? You mentioned it before, I think?
@jalf Yes, I started a blog on monday, I'm surprised to find it promoted to the top results for "gcc c++11"
It's kbokonseriousstuff.blogspot.com (Sorry for the silly name.)
it's not even on page 1 for me ;)
sbi
sbi
@kbok Room owners can move messages to other rooms.
@kbok That's very likely google customizing your searches.
12:05
@sbi I was talking about question flagging. There used to be a "Move to SF/Programmers/etc" option.
@sbi It's on bing.
sbi
sbi
@kbok It's still there for me.
weird
ah yeah, #5 on bing
anyway, do people actually use bing?
sbi
sbi
I just checked with a random question, and when I click on close and pick "off topic" it offers several SE sites.
Oh, maybe the option was unavailable because the question was already closed, but I couldn't see it because it only appears on refresh.
@jalf Isn't it the default IE search engine ?
sbi
sbi
12:08
@kbok probably, but then I have two questions: "do people actually use IE", and "do people actually use the default search engine in IE"
I don't use IE... UGH
@jalf Some people (like my mother) just actually don't give a fork.
most not-so-computer-literate people I know use IE
bwah, if only they realized...
sbi
sbi
@TonyTheTiger Most I know have been sternly instructed to use the FF I installed on their computer.
12:11
@kbok yeah, but the IE users I know still use google
@sbi I gave up trying to tell people to use something else...
sbi
sbi
@TonyTheTiger "If you're using IE, don't even bother to call me when you run into a problem."
just like trying to tell a not-so-computer-literate person the need for a virus scanner or firewall
@jalf You know, some people had a hard time finding the power button. Sometimes you can't ask much.
or do updates on a regular basis, people just don't get it I think
12:14
Anyway, I use bing from time to time to test the SEO rankings of the websites I build :)
@sbi hahah nice one
@sbi This one doesn't appear on closed questions.
I don't know why MS is trying to compete on the Search Engine market, I mean, Google is pretty much established in this field, nothing MS do will ever get them to where Google is in this field, imho
sbi
sbi
@kbok Presumably because there's no "close" link on a closed question?
@TonyTheTiger That was once said of Netscape, and later IE. And what about MySpace?
meh, well, they don't hold any prominent market positions today, do they?
Netscape is dead AFAIK, IE sucks, and MySpace is for retards
12:18
@sbi I have no "close" link, I have only 1k imaginary points. So I don't know how it works under the hood, I just use the flags.
sbi
sbi
@kbok Ah, you're flagging? I don't think I ever did that. So that's what's different for you.
@kbok Well, if I flag a question, and click on "it doesn't belong here", I get to the same choice I get when I click on "close", where clicking on "off topic" again leads to the dialog pasted above. But that could be different for me due to my rep.
The only difference is that the button says "Flag" instead of "Close".
Hi, does anybody know what the problem is here? ideone.com/p487E strange error messages
@Ricky65 You have invisible chars in your code.
ok, very odd
12:26
ah, cool
Uh, I reversed x and -x, lol
Well, you see the point.
yes lol
strangest error I've seen for a while
0
Q: C++ FAQ - Undefined Reference to Static Member

MankarseI just wrote a class with some static data members, but now I am getting errors about "undefined references". Why doesn't this work? What am I doing wrong? (Note: This is meant to be an entry to Stack Overflow's C++ FAQ. If you want to critique the idea of providing an FAQ in this form, then th...

sbi
sbi
12:43
Is this indeed a valid and useful FAQ entry?
I don't think so.
Are you working guys?
I wish I did.
sbi
sbi
@kbok Me neither. This is certainly a valid question, and might be well-answered, but I don't see this as a frequently asked question (nor as one that should be asked by people not knowing they should ask it.).
I've been staring at my screen for half an hour now.
sbi
sbi
12:48
@ManofOneWay We're chatting.
@kbok This could be work, too.
@sbi: You apparently do not hang around C++ IRC channels. This IMHO comes up fairly often.
sbi
sbi
@wilx No, indeed, I do not.
@sbi Thats sounds like a terrible job.
sbi
sbi
@wilx But should we even cater to questions that are frequently asked elsewhere?
@sbi Actually this is a recurring question on stackexchange as well. One of the most common duplicates I would guess.
12:50
Sorry, I am bit new to all this. I thought that it would be a good question on the basis of the 20-30 times that it has been asked
sbi
sbi
@Let_Me_Be Well, if that's indeed true, I'd gladly leave this as an FAQ entry.
@Mankarse If you're new to this then that would have been all the more reason to discuss it here first.
Anyway, I'd be fine with this if it indeed is a frequently asked one. Can you guys provide links to a few recent dupes for this?
@sbi Aren't exact duplicates purged?
sbi
sbi
@Let_Me_Be Only if they are closed as exact dupes. But with enough rep you still see closed questions.
3 relatively recent ones:
0
Q: static member variable in a class

user673769Why do I have a "undefined reference to Monitor::count" error for the following code? Thanks! #include <iostream> using namespace std; class Monitor { static int count; public: void print() { cout << "incident function has been called " << count << " times" <...

1
Q: (C++) "undefined reference to" error. (from a member function to static member variable)

user577001I got a following error upon linking. A member variable ClassBB::THR can't be accessed from a function ClassBB::bound(). What's strange is, from ClassBB::setThreshold(T v) function, which seems in the same condition with ClassBB::bound() in that both are template member function, ClassBB::THR ...

1
Q: Problem in C++ class with static variables and functions

inam101Can someone tell me what is problem in the following class, g++ is giving errors on ubuntu: class FibonacciGenerator { private: static int num1, num2, counting; public: static void Reset() { num1 = 0; num2 = 1; counting = 1; } ...

sbi
sbi
13:05
@Mankarse Ok, I'm convinced. I thank you for this addition to the FAQ idea!
However, I'd propose that something is to be said about static members in class templates, and someone might want to add a few words about all the other meanings of static in C++.
I meant to ask. A new semester is closing in and as always I'm refreshing my materials for C and C++. I was thinking about providing video tutorials this year as well. The problem is that I can't decide on the format. I could do objective oriented videos, like "Let's solve the problem of three cannibals and three missionaries in C++", or do basically what I do during the lectures, that is speak about a specific feature and provide some examples along the way. What do you think would be better?
As a student I can say I always prefer having to apply it myself rather than being lectured on a feature.
@Collecter Well the thing is. When I do "solving a specific problem" type of video I can't go very deep into theory. What I can do is explain why feature X is used here, and why not to use feature Y in this context. But I can't really explain all the nuances. In a video that would explain a specific feature I could go as deep as I would like, but the curve is usually very steep (which isn't necessary bad in a video tutorial).
@LetMeBe I thought you were talking about the lectures, which i prefer to be objective based. In the videos go as deep as you want, that can be watched in my own time, not solely when I am (potentially) half asleep in class.
British people have the strange habit of saying "Lovely" on the phone. It sounds very feminine.
13:26
:)
sbi
sbi
That. Is. Actually. Quite. Lovely.
Still no youtube access for enterprisey java programmers.
You're an enterprisey Java programmer?
Rob
Rob
ew, sounds gross.
I'm a (enterprisey java) programmer.
13:34
SCons > CMake.
(Sorry for being late, I took a nap.)
@kbok I'm sorry.
@CatPlusPlus CMake boost modules are broken on windows. This sucks.
@kbok Isn't entire java enterprisey? I thought that that was the only reason why it was used.
I'll blog about that soon.
CMake is broken as designed.
13:35
@Let_Me_Be There's also Minecraft, lol
I've always wondered why notch (the guy who wrote Minecraft) chose Java.
Probably because he knew it best.
@kbok at a wild guess I'd say "because he already knew Java well"
That's what I thought too, but that's a very poor reason.
@CatPlusPlus what does scons do better?
sbi
sbi
13:37
@CatPlusPlus But is CMake actually designed? When I looked at it, it seemed more it, like, mushroomed.
2
I've never used it
@kbok Well, Minecraft is sort of enterprisey :-D A game that should generally run on a 300Mhz machine with 64MB RAM is making my new home machine melt :-D
@jalf Everything. It has a real language behind it, for one, not some pseudoscripting thingy written on a toilet paper in 5 minutes.
@Let_Me_Be Yes, that's awful. And people don't believe me when I tell them this is anormal. "But there's at least 500 cubes to display !!"
It doesn't use Make.
It doesn't call itself repeatedly just to print pretty coloured messages.
13:39
@CatPlusPlus scons uses python, right?
Yup.
It doesn't generate anything (though it can generate e.g. MSVC solutions if needed), but rather builds directly.
@sbi CMake actually has a long history (see wikipedia), so I think it mushroomed indeed.
There were mushrooms involved, all right.
Especially when they made that language.
sbi
sbi
@CatPlusPlus But does CMake actually have a language? When I looked at it, what they used seemed more, like, an ini file on steroids.
SCNR.
But being Python is SCons's biggest selling point, because it's not artificially limited, and if you happen to miss a feature, you can just code it.
13:43
@CatPlusPlus Well, that's a problem. Writing a build script and then writing scripts that make packages from that build is a pain. Especially when you need to maintain that for multiple different platforms. I should know. I'm working on a super old C project that we deploy on 32/64bit x Debian5/Debian6/SLE/RHEL
@Let_Me_Be What does that have to do with generating Makefiles?
@CatPlusPlus That Cmake is a generator. And can not only generate Makefiles, but also RPM spec files (I'm not sure about .deb).
It's hardly CMake-only feature.
so in what situations would you use a boost::weak_ptr ?
When you need a weak reference. :P
sbi
sbi
13:47
@TonyTheTiger If you feel like you need to use a weak pointer, you're not C++ programmer material.
@sbi what do you mean? It's a bad thing?
sbi
sbi
@TonyTheTiger You of all people here should be aware when someone's pulling your leg!
It's been added to C++11. I doubt it would if it was that bad.
@CatPlusPlus anyway, "everything" isn't super specific to someone wondering if scons is worth trying ;)
@sbi damn it, I fell for it again!
sbi
sbi
13:49
@TonyTheTiger There's worse things you young folks could fall for. :)
Other young folks?
@sbi yea hot girls for example :)
@jalf Well, it is, IMO. It does require bit more boilerplate code, but the fact that you ditch make alone... ;)
If I get it right, a weak_ptr is basically a shared_ptr which does not increases the reference counter and which does not allow to (directly) access the contained pointer ?
Yes.
It's useful to break circular references, which screw up shared_ptr's ref-counting.
13:51
I see.
It has a lock() member that returns shared_ptr, so you increase the refcount only when you actually use it.
It's not something you will use that frequently, but it's nice to have.
The price is that the pointer might disappear in the meantime.
And lock() will return an empty shared_ptr.
> Notes: expired() may be faster than use_count().
Why ?
@kbok To allow linked list implementations.
13:53
Implementation details.
Testing for an empty list is O(1), but getting its length is O(N).
Ok.
sbi
sbi
@TonyTheTiger Right. It's a bad tendency with young men to fall for hot girls, rather than, say, nice girls.
What if they're nice and hot?
They're taken.
sbi
sbi
13:57
@RMartinhoFernandes What about it?
Anyway, SCons can generate RPMs and MSIs out of box.
@CatPlusPlus I have to try that
@sbi Is it a good or bad tendency to fall for nice and hot girls?
And I mean ((and (nice hot)) girls), not (and (nice girls) (hot girls)).
Aaaah, Lisp.
sbi
sbi
@RMartinhoFernandes But if you are really in love with a nice girl and do not think she is hot, then there must be something wrong with you!
14:01
@CatPlusPlus Less ambiguous than English.
@sbi Ok, you got a point there.
What's "summer 2004"?
Not a season.
sbi
sbi
Wow. Now HTC sued Apple. I have long since lost track of who sued whom in this game.
From context, seems like software.
14:05
@CatPlusPlus so how does it integrate with VS, say? Does it generate solutions like cmake does?
@sbi Assume that ∀X ∀Y X sued Y.
@jalf It can, yes.
that's a year old though, missing a half dozen arrows, i'd imagine
@CatPlusPlus Where were you when I needed that advice :(
It is a full graph now, right?
14:07
wow, Nokia is suing and being sued by a lot
It's now in 4D.
ah, there are heaps of these
and one that's only a couple of months old:
that thing is so small I can't read it
@jalf Ah, thank you.
14:09
yeah, try clicking on it now
Seems like HTC was already suing Apple at that time.
I bet some of those that are suing each other, are doing it over the same patents.
very likely
US software patents are just ridiculous
I can't help but think of children each pulling on one end of a toy, screaming "It's mine!".
They really are bad.
14:18
it's bad because the USPO grants obviously wrong and already done patents
and then it's bad because they last for fucking ever, granting the holder a monopoly
and then it's really bad because the patents can apply to virtually anything
it's like a government-enforced monopoly
@DeadMG Don't forget that the USPO relies on the patent application fees for their income, so they have a financial interest in granting as many patents as possible
which sounds like something out of a Pratchett book
@jalf They are application fees, so they get paid whether or not it is granted
sbi
sbi
@jalf Only less witty.
actually, they initially refused to grant software patents
but the US courts forced them to grant software patents in 1998 or something
@sbi But the ridiculousness sounds about right.
14:23
@Collecter but how many applications do you think they're going to get if they start rejecting patents? ;)
that's why stuff like "operating system" and "keyboard" isn't patented
and why the mobile phone industry is in such trouble- because their technology is all very new and all patented
@jalf I do not think it would be a significant change. In fact they could increase forcing people to reapply
@Collecter And eventually companies just tell them to fuck off and get their money somewhere else.
Companies apply to patents because they want money, not patents.
@Collecter how many companies would be willing to pay thousands and thousands of those fees for something they knew would be rejected?
@jalf Not a lot, which would cut down on the amount of absurd patents. The USPO would also need less staff because less would be coming in. So less money spent by the USPO so the less they need to charge. This really seems to be a cycle
14:29
Money and more money sounds better somehow.
@Collecter i see two problems with that: 1) why would they lower the fee, even if their expenses dropped, and 2) if they cut staff because of fewer patents coming in, then their expenses would drop proportionally with their income. They'd only be able to lower the fee if they could process more patents per staff
I think I have forgotten to set a linker directory somewhere with this error: fatal error LNK1104: cannot open file 'libboost_serialization-vc100-mt-gd-1_46_1.lib'
just forgot which one? (VS2010)
@jalf True on the second point, and for the first maybe the fed gov decided to actually give them funding.
but fewer staff for fewer patents would result in (at best) the same cost per patent. Realistically, economy of scale probably means the expenses per patent would go up a bit (due to fixed costs being amortized across fewer staff and fewer patents)
anyway, it's pretty hypothetical
And more money sounds better, so why bother?
14:31
I'm just pointing out that it's kind of silly to give them an economic interest in gaming the system
@TonyTheTiger The one where boost is installed?
@RMartinhoFernandes that sounds likely
@RMartinhoFernandes what setting do I have to add it to? I've already put it under the include dir setting
@TonyTheTiger it's under linker settings
@jalf additional dependencies?
14:33
@TonyTheTiger It's got to be under the library dir setting.
nah, additional library directories
additional dependencies is just the lib file names it should look for. The other one says which dirs it should look for them in
It should be next to the include dir setting.
I don't remember exactly where.
hmmm, doesn't seem like my boost/libs dir contains any lib files
perhaps I should build it first?
I can use boostrap.bat for that?
14:38
You run booststrap.bat and then b2 I guess. There's some docs in the site.
Is there a reason you didn't use the one-click Windows installer?
Oh, for 1.46 it's still bjam, not b2.
@RMartinhoFernandes I did use AFAIK
Oh, I thought that was supposed to get everything right.
well, no sign of .lib files
meh
Well, build it.
doing that
14:50
"If you can't link them, build them." Meh, I thought it would sound better.
it says I have to have patience
Yes. It usually takes about forever to build.
So I'm extending my overload to support member functions. What's the easiest way to handle ->* vs .*?
AFAICT writing a trait for that seems the most straightforward thing to do.
btw what is that ->* operator called?
@RMartinhoFernandes well hopefully my Quad core machine can do it relatively quick
I think I both found an easy way to do what I want and a use for my dependent_true helper.
I can do SFINAE with typename std::enable_if<dependent_true<decltype(expr)>::value, return_type>::type, checking arbitrary expressions.
Overload resolution will succeed if/when only one of those expression is not an error.
15:00
What's dependent_true?
Has a weird name.
Oh you're right.
It should be dependent_true_type
I don't know why I never realized that before.
template<typename T> struct dependent_true_type: std::true_type {};
I should probably make that a variadic template while I'm at it.
Huh, I still don't know what it does :(
Well
What's std::true_type::value?
What's dependent_true_type<T>::value, for any T?
15:06
Oh, it makes sense now.
Bizarrely it's half working.
I've overloaded operator() on ->*/.*
"checking arbitrary expressions." now makes sense.
Calling it with an object works; so that means no overloading ambiguity.
Calling it with a pointer makes a hard error.
So no SFINAE.
I don't get it.
    template<
        typename C
        , typename = decltype( (std::declval<C>().*std::declval<element_type>()) )
    >
    Ret
    operator()(C&& c, Args... a) const;

    template<
        typename C
        , typename = decltype( (std::declval<C>()->*std::declval<element_type>()) )
        , typename = void
    >
    Ret
    operator()(C&& c, Args... a) const;
Isn't that neat?
I got rid of the enable_if/dependent_true_type stuff.
I'm still checking if SFINAE is allowed to work here.
15:15
Args... and element_type are part of the class template arguments this thing is declared on, right?
Correct.
If you remember overload, it's a tuple-like class that stores functors and exposes an overloaded operator() that delegates to the stored functors.
Now I'm extending the functionality to member functions.
What did you end up calling that nasty macro?
Well I can't go around that GCC bug so for the moment I'm not using it.
Yeah it's not here anymore. The rest of the stuff is though.
overload.cpp|214|error: parse error in template argument list
wut
Als
Als
This became an faq?
auto overload = annex::make_overload<int (local::)(char)>(&local::operator());
Anything suspicious about that line?
Okay so that's not valid apparently.
Als
Als
hola...pin drop silence!
Als
Als
@kbok: I see
Oh btw, I am pleased to announce I have a secret admirer here
:P
15:38
ohla
what's new @Als?
Als
Als
4 mins ago, by Als
Oh btw, I am pleased to announce I have a secret admirer here
That's new :P
Ok, we get it.
who might that be?
lulz
@Als Why ?
Als
Als
@TonyTheTiger: I hope some hot chick!
lol
15:40
@Als hope for you too :), but in this C++ Lounge there's no hot chick afaik
Als
Als
@kbok: Check out my profile, the admirer upvoted most of my old answers
@TonyTheTiger: I think there is, just hidden from us :P
ah I see
lowl
Als
Als
@kbok: Hehe
@TonyTheTiger: Jealous ah
:P
Als
Als
15:44
@TonyTheTiger: They will steal it all away tonight though i think
meh, how so?
Als
Als
The fraud detection algorithm will detect it i think, & i hope
if not we know the So algorithm is broken because i find it hard to believe that different users did the upvoting within such short span of time
yeah, it'll probably vanish when they do a recalc
Als
Als
Who would do that though
I wonder
bots?
@RMartinhoFernandes I'm not exactly sure what I did is legal.
Als
Als
15:51
@LucDanton: Want me to call the cops? :P
Oh noes!
Als
Als
@LucDanton: what did you do, anyways?
Try to use defaulted template parameters for SFINAE.
42 mins ago, by Luc Danton
    template<
        typename C
        , typename = decltype( (std::declval<C>().*std::declval<element_type>()) )
    >
    Ret
    operator()(C&& c, Args... a) const;

    template<
        typename C
        , typename = decltype( (std::declval<C>()->*std::declval<element_type>()) )
        , typename = void
    >
    Ret
    operator()(C&& c, Args... a) const;
    template<
        typename C
    >
    decltype( std::declval<C>().*std::declval<element_type>(), Ret() )
    operator()(C&& c, Args... a) const;

    template<
        typename C
    >
    decltype( (*std::declval<C>()).*std::declval<element_type>(), Ret() )
    operator()(C&& c, Args... a) const;
New approach
And now I have too much SFINAE and overload resolution doesn't succeed.
That requires DefaultConstructible.
Why not decltype( std::declval<C>().*std::declval<element_type>(), std::declval<Ret>() )?
I was going to mention that: by this point, I might as well forget Ret and use std::result_of.
Wait can std::result_of work with SFINAE?
template<
    typename C
>
decltype( (std::declval<C>().*std::declval<element_type>())(std::declval<Args>()...) )
operator()(C&& c, Args... a) const;
Nets me a hard error.
16:06
Where do people go to learn codes like this? I learned CSS, HTML and JavaScript on w3schools.com.
@SilverHorn C++ you learn from a book
Those queer things made of stacked dumb paper.
Some are also available in smart paper though.
Hello @EtiennedeMartel :)
Where is SFINAE in the standard (N3290 preferably)?
14.8.3.1
Don't know if there are others applicable paragraphs.
The wording in that paragraph doesn't seem to apply to most uses of SFINAE. For instance usage of std::enable_if.
16:14
14.8.2/8 helps make it clear.
> If a substitution results in an invalid type or expression, type deduction fails. An invalid type or expression is one that would be ill-formed if written using the substituted arguments. (...)
I huh can't find your reference. I'm slow.
Er, it's on page 383.
So that does mean that my original use of defaulted template parameters should trigger SFINAE then.
Time to do what I always do when GCC lets me down.
Slack.
16:29
@SilverHorn from the site renowned for its incomplete, inconsistent and factually wrong information? I see you're continuing web dev's proud tradition of bad coders writing terrible code based on incorrect teaching
16:51
@jalf slightly unfair
it's not just web dev's that are bad coders writing terrible code based on incorrect teaching
@Raynos Yes. I don't know if he's a bad coder
We can say that of every development displine
@raynos:
But I do know that web dev is plaged by bad coders, and that that specific website is great at creating bad coders
I agree
16:52
virtually all developers are bad programmers :)
@Raynos but few have caused as much pain and suffering as bad web developers
and that wasn't my point, anyway. :)
@TonyTheTiger where do you test it?
My point is that he learned web development from a site that ought to be nuked from orbit, which means that whatever he learned really really should be re-learned from a sane, reliable source
F.Y.I. I'm not a bad developer
PHP again?
16:54
No, w3schools. You can go back to sleep.
Not that much far.
it's funny, I've never heard anyone say "F.Y.I. I am a bad developer"
sleep:ICouldUseSome();
@DeadMG From the missing colon, I gather you could use some sleep :P
it could be a label
target of a goto
16:55
actually, it's Lua
I'm flagging it. This is not the Lua room :P
Is it valid Lua, btw?
If it looks weird, then yes.
yes, indeed it is, given an appropriate variable definition
Als
Als
@RMartinhoFernandes: Goddamn it don't flag it, it is really becoming a nuance
@Als Don't worry, I won't. I was just kidding.
16:57
local sleep = { ICouldUseSome = function(self) print("sleeeeeep...") end }
sleep:ICouldUseSome();
Admit it, you changed your mind to make it Lua after my comment.
I've worked in Lua for longer than I have in C++
So, you're a Lua Expertâ„¢ too?
oh yes

« first day (305 days earlier)      last day (4869 days later) »