« first day (548 days earlier)      last day (4401 days later) » 

sbi
4:00 PM
Well, I guess I will have to make a fuss on meta then. Lemme write that question...
 
Fried Sock. So honoured to have you. Is it any good?
 
Hi guys, does anybody know if there is any C# class initilization syntax like the c++ way i.e. class C{ public: C():m_1(initialValue) { code }
 
@CaptainGiraffe Absolutely. But not like that. It has uniform initialization but not base/member initializer lists. Does that answer your question?
 
@sehe It does perfectly. Thanks sehe
 
@CaptainGiraffe Ow, I just remember you can have similar syntax for structs. Let me test it
@CaptainGiraffe What I remember is constructor chaining. You can do:
    struct X
    {
        public readonly int A, B, C;

        public X(int a, int b) : this()
        {
            A = a;
            B = b;
        }
        public X(int a, int b, int c) : this(a,b)
        {
            C = c;
        }
    }
 
4:20 PM
@sehe Oh, thats cool, didn't know about that one. You you know when that was introduced? (I can look it up of course). Sharks again sehe.
 
@CaptainGiraffe No tanks. I'm a pacifist :)
Also, I think C# 1.0 must have had it. AFAIR
 
@sehe Ok, so its not new at all. Peace and Love to you sehe.
 
6
A: C# constructor chaining - changing the order of execution

Eric Lippert I want to know how to change the order of execution when chaining constructors in C#. You don't. There is no such feature in C#. There already is a mechanism for calling arbitrary code in an arbitrary order: make a bunch of methods and call them in the order you like. Here's my article on ...

@CaptainGiraffe Sharks :) lol
Also see http://www.codeproject.com/Articles/7011/An-Intro-to-Constructors-in-C (dated 2004, .Net 1.0)
The subject won't update anymore, sadly
 
sbi
@sehe That's hilarious.
Oh well.
 
@sbi I found that out a short while back in relation to comment one boxing:
Apr 9 at 22:25, by sehe
Funny. I edited the comment, but onebox won't show the updated comment even after re-editing.
 
sbi
4:26 PM
What if I link to it again?
2
Q: Can we please get the book question locked again?

sbiTo set the scene: In the recent Great Question Deletion Audit of 2012, this answer of mine — explaining why it's not in SO's inetrest to delete The Definitive C++ Book Guide and List question —, despite only referring to a single item on that list, became the top-voted answer. As some helpful com...

Ha!
1 message moved to bin
:b
 
lol, your title asks for it to be locked again?
 
@sbi Escape the 2-minute rule
@DeadMG Wrap your head around that, first
 
surely it should be "Can we please get the book question unlocked again"?
 
@sbi I tried that, with the comment link, and it didn't work. I'm quite sure there is a level of client-side caching involved here. Full - Refreshing the chat window might have done the trick as well
 
It's edited now, but I actually liked the previous title which looked more appealing to mods.
 
4:30 PM
I saw it
 
sbi
@DeadMG Dammit. (My daughter called and I got distracted.) Sigh. I fixed it.
 
Oh turns out I'm too dumb to make sense of locked, protected, closed and whatnot meta-states
 
@sbi Is cool.
 
^ Stray @-sign detected at start of input (@DeadMG)
 
@sehe Protected: You can only add answers if you're above a certain rep, 20 I think.
not sure about locked vs closed, though
 
sbi
4:33 PM
@DeadMG Locked is publicly visible, deleted is only visible to owners and >10k users., closed is still editable, I think.
 
@sbi then why can I see closed questions?
You mean deleted, I guess. :)
 
sbi
@classdaknok_t Damn, yeah!
 
Closed questions are editable and publicly visible, and can be unclosed by people with the close privilege. Deleted questions can only be undeleted by people with the delete privilege.
Oh the book question is unlocked already…
 
win:cakes()
 
takes:biscuit()
 
4:40 PM
has been* oh whatever
 
mmm... cakes
 
CakePHP
 
@classdaknok_t passé simple, aorist
 
Community wiki ftw.
@sehe present simple*
Voltooid tegenwoordige tijd.
 
must exploit all the temporal coherencies
 
sbi
4:44 PM
Well, now that we have the book question back, could you all please go through the remaining answers, read the comments, maybe add your own opinion if you have one, vote on the answers, and if a bad one is low enough, delete it? That's why what been given it back for, after all.
 
No problemo.
 
@classdaknok_t Ik vind de franse/griekse opvatting mooier hier: "Deze post werd al weer ontsloten"
 
@sbi Did we ever ask Will♦ why he unprotected + locked in the first place? I bet it is precisely because he didn't like the amount of voting/flagging arising from those 'late' answers.
@DeadMG REMOVE ALL THE TEMPORAL LOBES
 
4:48 PM
or maybe
you think that's better?
 
(zapped with a temporal stun gun)
 
sbi
Yep, thanks.
 
:3319267 I don't think sleeping can be stopped, it comes naturally
 
@sbi I downvoted all the answers!
 
4:51 PM
@sehe If you are sleeping and I punch you in the face with a rotten tyrannosaurus rex egg, you'll stop sleeping.
 
sbi
@sehe I suppose he just saw all the flags, that it is an old answer. and wanted to stop flags pouring in and bad answers being given. So he locked the damn thing and moved on. Allegedly there's always tons of flags for the mods to deal with, so I wouldn't really blame him.
 
@sehe Sleep is a disease caused by caffeine deficiency.
 
0
Q: read different data types in line c++

luisertaI'm starting in c++ and I need to read a binary file. I know the structure of file, i.e, each file line is composed by: 'double';'int8';'float32';'float32';'float32';'float32';'float32';'float32';'int8';'float32';'float32';'float32';'float32';'int8';'float32' or in byte numbers: 8 1 4 4 4 4 ...

> I'm starring in c++
If that were true, he wouldn't be using FILE.
 
sbi
LOL, someone really downvoted me asking to give us the book question back. Some people on meta truly are fanatics.
 
Hi all
 
4:58 PM
Hello
 
@sbi One more that should probably be gotten rid of: stackoverflow.com/a/6057537/179910 -- it's about C, not C++.
 
sbi
@JerryCoffin Thanks for pointing it out. Please add a comment saying so in order to make others aware that it is bad.
 
@sbi done.
 
I have a C++ OOP question: I have a class which is composed by other classes which derive from common base classes. The composed object only knows the common base classes. Depending on the users input it is composed with different classes, derived from their respective base classes. Now I have another class/Method which constructs these composed objects. Now I have to tell this Method of which exact classes the composed object should consists.
This would be something for some kind of reflection mechanism, which I don't have in C++. I thought about std::type_info but I don't think I can construct classes from there. Maybe I could use templates, but I would rather have things done at runtime..
any ideas?
 
The only way I see is a factory function (or lambda) for each class. You can then choose the right factory function at runtime. It should return an std::shared_ptr<BaseClass> (or unique_ptr if that works?).
 
sbi
5:05 PM
@Nils Yep, that's the way it goes. Polymorphism is great for information hiding, but someone, somewhere simply has to know all the types to instantiate them. There's numerous, often quite elaborated, patterns to do this, but what with linkers being allowed to eliminated unreferenced objects, those featuring an automatic registering to simulate reflection are usually non-portable.
 
So the base class would define a static factory method which returns an instance of the base class.
..and this could be overwritten to return an instance of the actual class when called on a derived class
 
It returns an instance of a derived class, but it returns it as an std::shared_ptr<BaseClass>. You can then use dynamic_cast or typeid later.
I'd go for a free function, actually. But it depends on your design.
 
@sbi this actually makes me wondering how Objective-C is linked..
cool
I don't use shared ptrs so far, just a composite pattern.
 
@Nils In Objective-C 1) Every object is on the heap. 2) Every single method call is resolved at runtime, no stuff like inlining. 3) Every single method is virtual.
And you can add and remove methods at runtime. :P
 
sbi
Well, I gotta go home now.
 
5:11 PM
@classdaknokt the objects are on the stack?!
what about the arc removing them then..
 
Whoops, heap. :P
Objective-C doesn't require linking for method calls. You can send any message to any object, and when an object doesn't respond to it, it simply throws an exception.
 
ah yeah.. that's probably because they are called messages and not functions..
 
and not function calls*
messages are similar to function calls
 
I want C++11 and lambdas!
stuck with VS008 at work
:D
 
Andrei Alexandrescu would say "contact headhunter"
 
5:15 PM
10 mins ago, by class daknok_t
The only way I see is a factory function (or lambda) for each class. You can then choose the right factory function at runtime. It should return an std::shared_ptr<BaseClass> (or unique_ptr if that works?).
Why the hell was this starred?
 
sbi
@classdaknok_t FTFY.
 
Thanks. :P
 
sbi
:b
Anyway, I'm afk now.
 
Später!
 
@bamboon So far I haven't seen a headhunter which brings good C++ jobs..
C++? ah we have a .net project here..
 
5:17 PM
@Nils then look for them yourself
 
sure
@bamboon may I ask where u live?
 
@Nils germany
 
ah..
I'm Swiss..
 
oh oh
 
I'm neither German nor Swiss.
 
5:19 PM
I am not yet in the work business though
 
@bamboon which part of germany?
 
@Nils bavaria
 
ah I've never been there..
 
@Nils it's close to you
 
yeah I looked it up on maps
anyways I have to go
cu
and thx for the idea @classdaknokt
 
5:24 PM
@Nils Here is a demo. ideone.com/tm32K
You can find out at runtime if you want to call d1_factory or d2_factory.
 
ur quick, thx!
 
No problemo.
 
Blah blah blah.
3
 
I'm exhausted.
 
5:29 PM
Seen too much C++ code for one day, right?
 
I woke up at 03:00, drove 70 km to airport, dropped off my uncle, drove 70 km back to my parents's house, slept until 13:00, drove my mom 30 km to the hospital, drove back, and then drove 30 km here (home). I haven't seen a line of code today yet.
 
@classdaknok_t or pass one of them as an argument to a function (using a function pointer or, even better, std::function).
But you can't have a pointer to a constructor, afaik, so you need a factory function.
@RMartinhoFernandes "I haven't seen a line of code today yet." So this is the best day of your life, right?
 
Anyway, I have to go for an hour. See ya!
 
5:57 PM
ohai
 
Ell
hii
i finally found out the reason of my linking errors (I think)
I believe g++ is trying to link with x86_64 versions of the standard library for some reason
anyone know how to stop that?
 
@Ell Explicitly link to the 32-bit version?
Like, with the full path to the file.
 
Lorem ipsum is for wusses. Real men use Arnold ipsum.
 
Ell
oohh no wait a minute
it is supposed to link to the 64 bit version, i thought x86 meant 32 bit?
 
6:09 PM
@Ell x86 is a family of architectures including i386, i486, and so on. Hence the x. The _64 suffix means the 64-bit version.
 
Ell
oh darn -.-
then I have no idea why I get link errors
arghh. How do I find out which version of a file is included?
 
@Ell I'm sure there's a debug option for that. Try --verbose. If that doesn't work, I'd consult the man page.
On another note, jeez, GCC's source repository is huge.
 
Ell
ah kk
haha :L
 
@ildjarn: Maybe we should have asked for the submission URL and the name to submit under?
 
Ell
-m makes a dependency file listing includes a file depends on
it appears its using all the right includes
 
6:18 PM
Is there any difference between `command` and $(COMMAND)?
Urgh.
There should be backticks around the first one.
 
What are you talking about?
 
Bash shell.
 
I don't think so?
 
Oh, Bourne again shell shell. I see.
:P
 
@RMartinhoFernandes Sorry. xD
GCC is still checking out.
 
6:19 PM
Wait till you get to the building part.
 
I can't wait.
 
@RMartinhoFernandes It's a shell, and again a shell, and again and again, over and over again a shell.
 
Ell
arghh
 
> telephony log information like your phone number, calling-party number, forwarding numbers, time and date of calls, duration of calls, SMS routing information and types of calls.
What kind of "legitmate-ish" goal could Google have to collect this kind of information?
 
Making your searching experience better. :P
2
 
6:31 PM
How does knowing who calls my telephone help that?
 
@Ell What are you trying to build?
 
Ell
@Maxpm the simplest of boost::asio programmes, I will put it on pastebin, gimme a sec
@Maxpm its mainly a building issue - it has no code yet, would you mind if I sent you a tar?
 
@Ell Go ahead. I'm just leaving school now, so I'll take a look at it when I get home.
 
Ell
kk :)
@Maxpm I have emailed you, suggest to me a quicker way to do it if you know one
and also, aaah media fire needs a sign up now :O
 
6:55 PM
Can someone with a recent build of clang (fail to) compile this for me? ideone.com/ZfGXX I need the error message.
 
Ell
I will install clang now :) as long as its easy :L
 
I don't think that will work on the 3.0 release.
I was hoping for someone with a trunk build (@Xeo?)
 
Ell
sorry i dont have clang at it seems too much effort at the present minute to isntall :L
on my new shiny vm :)
 
No problem.
 
@RMartinhoFernandes I have a trunk build at home -- I can try it in a few hours
 
6:59 PM
Thanks.
 
Xeo
7:30 PM
@RMartinhoFernandes Sorry, didn't update in weeks
But I think you could try on the llvm IRC channel
 
hey
i have got a question on socket programming
are the structures sockaddr and sockaddr_in defined in sys/socket.h or we have to define them everytime we write a program
 
Yes they are in <sys/socket.h>.
 
ok thanks
 
Xeo
@RMartinhoFernandes, Clang bot on #llvm returns "expected expression", but sadly doesn't mention where. :|
 
@RMartinhoFernandes pastebin.com/xv9i5c3t (forgot I can SSH to that machine :-P)
 
7:41 PM
Sweet, thanks.
0
Q: Is substitution failure an error with template aliases?

R. Martinho FernandesLet's say I have these template aliases: enum class enabler {}; template <typename T> using EnableIf = typename std::enable_if<T::value, enabler>::type; template <typename T> using DisableIf = typename std::enable_if<!T::value, enabler>::type; I can do the following in...

If anyone is up for standard diving, there's rep.
 
Xeo
@RMartinhoFernandes Obviously, the question is... what does it say if you don't use template aliases?
 
@Collin?
@Xeo How silly of me.
 
?
did I mess something up?
oh
 
No, no, it's fine. But I hope you don't mind testing this one: ideone.com/pQ1m8 :)
 
My school laptop is having severe charging issues. This is troublesome.
So @Ell I won't be able to test that for a bit.
 
7:48 PM
 
Ok, so my title is completely misleading.
 
Xeo
I think the question should actually be about dependent non-type template parameters
Heh
 
Curse this infernal contraption.
 
Xeo
@RMartinhoFernandes: I asked one of the clang coders in #llvm about it (aka I linked your question). Let's wait and see
 
What do other compilers have to say about it :) ?
 
7:57 PM
I have no other compilers at my disposal.
 
I'm gonna toss it into MSVC 11 beta.
 
Xeo
I'll try MSVC11 dev preview
 
I wouldn't give much consideration to VC on this (it uses its own particular brand of templates), but I wouldn't mind seeing how it barfs on it.
 
Xeo
Okay, first thing: MSVC11 doesn't have enum classes
 
Hello pleasently populated room
 
7:59 PM
@Xeo Make an old school one, and initialise to 0.
 
enums are gone now?
 

« first day (548 days earlier)      last day (4401 days later) »