« first day (635 days earlier)      last day (4310 days later) » 

user1174868
12:00 AM
I can not read scheme at all
 
user1174868
this is infuriating
 
Ell
which bit don't you get?
 
user1174868
I got it, I am just not happy about it
 
Ell
well if its any consolation
I can't read it either :l
 
user1174868
c++ seems so much easier to read
 
12:15 AM
lol @ Youtube comments
 
user1174868
I heard these two people infront of my a couple days ago, one was talking about hwo he was in the military and said how he had like 30 confirmed kills ( couldn't hear the number) and then he explained to the other guy on the official process of getting "confirmed kills" about how the base commander has to approve it and other stuff, it was hialrious
 
flump
 
flomp
 
user1174868
I also met this homeless guy once who was wearing this ridiculous uniform with airbornse patches on it and he wanted to tell us vietnam stories, that was a pretty good lunch
 
user1174868
12:25 AM
to be clear, the man was just a crazy-man and definitely not in any way a veteran
 
@TonyTheLion You go for any hole, huh?
 
found the hole for the interwebz to crawl into out of emberassment at what it has become
@DeadMG lol, I actually didn't think of this as something sexual
 
well, I'm in a flump mood, so
 
Ell
what is flump?
where I come from if you feel flump it means you feel like you loon gross and unappealing
 
flump: fall heavily
 
12:28 AM
flump is kinda difficult to define
it's more the absence of anything, rather than a thing itself
 
donno how that relates to a mood
@DeadMG so you're in a mood that is absent of any other mood?
so a "no-mood"
what brings you in such a flump mood?
 
probably clinical depression
 
Ell
also I've never had a burger king. what are they like?
 
oh god
 
Ell
oh dear :/ seek help from a professional!
 
12:30 AM
@Ell better than McDonalds, and worse than those you'll make yourself
 
Ell
never had MacDonalds either
 
it's actually kinda funny
 
@DeadMG how's the job hunt?
 
some other guy linked me to the Wikipedia page for depression, but then I realized how many symptoms fit my behaviour
not sure how to react
 
oh god, don't diagnose yourself with something you read on Wikipedia
you should know better than that
 
user1174868
12:31 AM
 
user1174868
people keep trying to tell me that I have that anterior pelvic thrust bullshit, people on the internet aren't doctors
 
@DeadMG don't dwell on it, makes it worse. Go do something else, find something to do you enjoy
 
user1174868
Oh and by people I mean internet people, I don't talk to people in real life
 
user1174868
John Henry was a steel driving man
 
user1174868
that sounds slightly sexual doesn't it?
 
12:37 AM
time for sleeping
 
Ell
@deadmg I'm pretty sure I'm "clinically depressed" - all that slows me from doing bad things is what my mother would think
oh nighty night :L
anterior pelvic thrust?
that certainly does sound sexual
 
Ell
12:52 AM
anyone here still?
 
I'm usually lurking.
 
i'm not, but just happened to see this. :)
 
Ell
@mystical you are always lurking :L you said that last time I asked :L
well since nobody is here ima sleep. night all.
 
1:11 AM
night
 
user1174868
1:23 AM
I google like a 9 year old
 
user1174868
"What is the thing called that you use to dig with"
 
@CatPlusPlus hm, yet another php rant
 
1:42 AM
I'm always around.. sadly I (almost) never sleep
 
i think people perhaps have forgotten about designing things. so here's a problem: using only XOR gates (e.g. the != operator in C++), decode a four-bit digit in the range 0...9 inclusive, into a seven bit pattern that lights a segment LED display that displays the digit (each output bit drives one segment of the display).
 
I did that in a now extinct class, except we used all NANDs.
 
i'm not sure it's possible using only XOR gates
:-)
 
Unlike NAND, XOR is not something-complete or whatever it's called, so you're probably right.
 
My last project before graduation was to build and layout a 32-bit integer wallace tree multiplier using only raw materials and vias.
that wasn't too fun...
250k transistors... done by hand. A lot of copy+paste
 
1:45 AM
@Mysticial I read that as "My last project before graduation was to build and layout a 32-bit integer blah blah something"
 
hello everyone :D
 
hai
 
Screw it. For now, input iterator support will be limited to // TODO: support input iterators.
 
I got a new mouse :3 i love getting new tech, even the small things count ^.^
 
Forward iterators forward the win.
 
1:47 AM
i ordered a camera. next week i'll take a photo of my boss and post it here
or not he he
 
xD
 
@CheersandhthAlf Is this part of that "post pictures of pretty girls" project of yours?
 
yes
she's pregnant
so she'll lend some weight to the project
 
lol
 
1:54 AM
slumgullion. Does it mean:
a stew of meat, vegetables, potatoes, etc.
a gadget; dingus; thingumbob.
 
There. The damn thing works for all but input iterators.
I win.
 
2:08 AM
0
Q: when should I use 'lock' in multi-thread programing?

Nick Dongwhen should I use 'lock' in multi-thread programing? Just lock the area which each thread will modify or lock the area which each thread can access even it will not be modified ? struct share_data { /* share data */ thread_id; } thread 1 will exceute main() function: Initial share da...

A good snarky comment would be:
"You should figure out what's locking your accept rate at 0%."
 
I don't like those comments.
They always read like "MOAR POINTS!!!twelve!" to me.
But the question is not a good one.
 
Neither do I. I'm not a big fan of insulting people I don't know.
It's like: The kid in me really wants to post that comment. But I know it's not gonna be constructive for anything other than a moment of humor.
 
Yeah, I get that.
 
"I'm terribly sorry, but using the break system on my car takes too long, simply because the ABS breaking system prevents me from an absolutely hard break. Therefore, I decided to use the handbrake, it allows me to stop the car very very fast. So, can you please tell me how to avoid sverving off the road and crashing all the time"? Uhm, no. Sorry, don't cancel/kill/terminate threads. Ever. Except if you're terminating the program and giving up its job load (ie. don't care about any results). Complain to the people that made the thread code. — Lasse V. Karlsen May 7 '09 at 11:47
 
That's quite an awesome analogy.
Assuming you know what an ABS is.
 
2:21 AM
If that was an answer, it'd be something I'd put on reddit.
 
2:34 AM
im finding css really fun to learn haha
css3*
 
Something's wrong. I have more tabs open in vim than in chrome.
 
It certainly makes sure that half the office has stickies with their password on their monitor or under their keyboard. — Peter DeWeese Jun 22 '11 at 19:44
 
Browsing old questions, are we?
 
yeah
 
Hey guys... good evening... Is is possible to have an list of objects of different types in C++? Before you go on and say no. Here is what I would like to do. All I want is to be able to track a list of objects and then pass them to a function that takes them.
 
2:46 AM
@jmlopez Make a super class for them.
 
@Mysticial...not quite
you see, I want this to apply to anything that you might throw at me
that includes basic types
 
boost::any.
 
say I have for instance: int a; double b.
 
I don't know what you could do that would work for any type, but well.
 
If you find that you need to do something like this, ask yourself this question: How am I going to use the values. Because you won't know what each type is.
 
2:47 AM
and I have functions void callme(int) and void callme(double)
 
And then design from that standpoint.
 
If the possible types are bounded, boost::variant is a far superior solution.
 
what do you mean bounded?
 
btw, I'm not too familiar with boost. So the robot's advice automatically takes precedence over mine.
 
2:49 AM
I'm not familiar with boost either
I really want something that can be done with standard libraries
 
Well, the only alternative is implementing those on your own.
 
How can I achieve that?
 
It's not terribly complicated, but it's not really trivial.
@jmlopez Which one do you want?
 
say I have a function callme for all the types that you throw at me
 
@jmlopez Exactly what are you trying to do. There's probably a better way than to force generics.
 
2:50 AM
Are the types known in advance?
 
well, the known types are the basic types
 
@jmlopez That fundamentally won't work, because overload resolution is done at compile time.
 
int, float, double
char
 
And nothing else?
 
and whatever classes you define the function callme
 
2:51 AM
Ah. That sounds a lot more feasible.
 
All I can say is that callme will be there
and if it isn't then, well, then there's an error
 
@jmlopez Sounds like something perfect for a Java-style interface.
 
I'll sketch up a solution. Gimme a sec.
 
sure, thanks. I've been thinking about this for the past year. I hope I can find a solution now that I decided to use this chat thingie.
 
@RMartinhoFernandes Is it a TMP trick? Or an interface/inheritance trick?
 
2:54 AM
@Mysticial Both!
 
I can't think of any other way to do it other than to build wrapper classes for the primitive types and have them inherit from a class that implements callme.
aka: C++ version of a Java interface.
 
now, remember, I want to create a list of objects, and only use the function callme right before I finish my program. The idea behind is that during my program I will be adding some objects to the list. And finally, when I finish I want to use this callme function.
 
@Mysticial Yep.
But you only build one wrapper class template.
 
@RMartinhoFernandes ah... gotcha
 
oh...:)
 
2:56 AM
clearly, I suck at C++... :(
 
I think I'm getting it, I like templates...
Not too good with them though
but I like their power
 
shit that was fast
 
i know... 0_0, now lets see...
 
@Mysticial :)
 
3:03 AM
That was so fast that I wouldn't even have had to time to take a shit and come back.
 
@Mysticial This is a well-known technique for type erasure (it mimics the erasure the Java compiler does with generics), so it was just typing it out. Thinking was barely involved.
 
sniff*... :') thank you so much @RMartinhoFernandes
 
posted on July 11, 2012

We can think of this encapsulation as a kind of syntactic sugar — but it has another useful property as well: Part of what is encapsulated is the pointer to the dynamically allocated object.

 
the only thing I don't recognize from there is: unique_ptr
can you do a little a explanation or should I just go ahead and google?
 
@jmlopez It's a smart pointer. That's supposed to help you not hang yourself with raw pointers.
 
3:06 AM
Well, using a vector<callmeable_base*> would require deleting all the pointers by hand. unique_ptr handles that. You can search on SO and find a wealth of information about it.
 
cool... :)
Finally I won't have to do the crazy stuff I did last year.
thank you guys
 
see ya
 
I think I'll sleep now, while my tests are green.
Bye.
 
@RMartinhoFernandes night
I guess I'm back to lurking since there's no one around. lol
 
3:09 AM
aww
lol
@Mysticial
yeah, probably, I find it kinda weird that no one is here
 
@jmlopez I have a separate tab on a separate monitor with SO and this chat window. So I'm usually busy with other things, but I occasionally glance over to see chat messages as well as new questions.
So I'm always here, even if I'm busy as hell and I don't feel like talking. (as is usually the case in the middle of the day)
 
Yeah, I bet. I think I would do the same if I had another monitor.
I actually do, my macbook screen and this ASUS monitor, but I always ignore the macbook screen, too small
 
im here, but im working on setting up css for a site. a job thats taking up both monitors xD
 
I've got 4 monitors. 3 side-by-side and 4th on top. The one on top has SO homepage and this chat window.
 
@Mysticial I wish i had a setup like that Q_Q
 
3:14 AM
sigh*, me too
 
im only running duals >.>
 
are you guys running Linux...?
 
windows
 
oh...
 
I dual boot. But Windows is primary
 
3:15 AM
nah, i have xp on my networks server, vista on my development computer, and 7 on my school computer.
 
vista on development?
isn't that a little heavy?
 
yeah, it hasnt given me any issues so far :)
it actually runs better then my 7 machine (cpu/memory) but ive tweaked it a bit.
 
anyway, this time I'm going to finish up with the code provided a while ago. Very excited to try it out.
 
im going to switch to ubuntu server version on my server computer soon though, once i get everything ported to linux.
as of now its serving as a teamspeak server/tcp server/udp server/http server
OMG i hate this video driver >.> atleast once a day it crashes haha
:3 I love indenting html code because when you look at it sideways, it looks like mountains ;D
 
3:42 AM
lol
only if you have lots of monitors and you look at them while you drink your coffee from far away
 
or when your half asleep :P
 
4:37 AM
@RMartinhoFernandes I thought you were asleep. :D
Do they emit Higgs bosons as they decay? — Hot Licks 40 secs ago
 
5:16 AM
#include<graphics.h>

#include<conio.h>

void main()

{

int gd=DETECT,gm;

initgraph(&gd, &gm, "c:/tc/bgi ");

circle(330,180,100);

getch();

closegraph();

restorecrtmode();

}
Linker Error:undefined symbol _restorecrtmode,_closegraph,_circle,_initgraph in module xxx.cpp
Why?
 
@Random All the regulars are asleep right now. You should try asking that on SO. But you'll need to provide more information than that.
 
user406009
@Random That's a linker error.
 
user406009
All the rest is a mystery to me.
 
I have solved that
 
5:37 AM
Random, did you find a solution?
try a make clean to start
 
6:07 AM
@Mysticial Oh well... I should :( Thought I could read just one chapter before falling asleep and... tvtropes.org/pmwiki/pmwiki.php/Main/JustOneMoreLevel
 
@RMartinhoFernandes lol
 
0
Q: How to pass a std::shared_ptr<Resource> to a function?

Martin DrozdikShould I pass it by value or by constant reference? I have read numerous rules of thumb on whether to pass a copy constructible object by value or by constant reference. Such as: pass objects by constant reference and built in types by value (except function objects) pass by value unless size o...

 
6:35 AM
0
A: Pointer and array address

FredOverflowIf p were equal to &p, the pointer would point to itself, which is only possible with void pointers: void* p = &p; assert(p == &p); I have yet to see a practical use for this, though :)

^ finally there was a reason to post the self-referencing void pointer on SO proper :)
 
@Umer: If s is an array, say, of type int[10], and you try to print it, it will silently convert to a pointer to its first element, which is of type int*. The type of &p, on the other hand, is int(*)[10]. As you can see from the type, &p points to the entire array, not just the first element. But since an array and its first element start at the same address in memory, you get the same output. We have a related FAQ which you might find interesting. — FredOverflow 3 mins ago
^ another attempt to de-confuse victims of array-to-pointer decay
 
@RMartinhoFernandes: On that topic, I'll admit I'm still dubious. How does your rule of thumb apply to the question "how do I pass a shared_ptr<...> to a function?" Let's suppose that mutability isn't an issue: const works fine for me. For concreteness, let's say my goal is to save a weak_ptr<...> pointing at the same thing into a private member. In such a case, do I want value semantics, or do I want reference semantics? Why?
 
@FredOverflow I just linked to that sometime ago, and was met with this:
@R.MartinhoFernandes I appreciate the help but the mentioned link seems way too exhaustive and complex for my question. Thanks anyways — prathmesh.kallurkar 2 hours ago
@Managu Do you need a different shared_ptr to make a weak_ptr? No.
So, reference semantics.
 
good morning
 
6:43 AM
Would I ever (realistically) want to pass by value if I'm treating the parameter immutably? I say "realistically", because I'm sure I could come up with a wild scenario in which this is the case. But we're talking rules of thumb.
 
Not really. And for that matter, C++ treats T const in parameters the same as T.
You can even declare void f(int x); and define void f(int const x) {}: it's the same function.
 
I suppose that was my confusion with your comment. Thanks for clearing that up for me :-)
 
i have a question with properly using enumerations
may i ask here or the so main site ?
 
@Managu Glad to be of help :)
@Abhishek Main site preferably. Unless it's something as simple as a yes/no question.
 
@RMartinhoFernandes updated
 
6:47 AM
Re: immutable value parameters: didn't know that, cool.
 
Well there is a library ffmpeg it defines codes in an Enum like this

enum CodecID{
/* 200 codecs */
};

I am trying to write a wrapper structure to wrap its functions.
But i am confused on how to pass the encoder as argument to my init(); function
 
@Managu If you hover over a post, you see three symbols to the right. Click on the rightmost one, and the answer will be linked to that post, and the author will be notified.
 
i know

#typedef enum{
/*stuff */
}blah;

then i can do blah x;
but that doesnt work in here
 
@Managu Some people use that to have the compiler verify that they don't accidentally change the argument in the body, without interfering with the interface.
 
@Abhishek Are you writing C? In C++, the typedef struct trick is not necessary.
 
6:49 AM
C++
 
@Abhishek surely #typedef is a typo
 
@Abhishek Then you can just say CodecID variable_name; even though you didn't use a typedef.
 
@FredOverflow: hrmm? Have I done something out of line? I brought my question to chat to avoid a long conversation in comments. With regards to your statement: when I hover over a comment, I only get 2 icons.
 
@FredOverflow Oh, I love that trick for linked lists. I always make my linked lists (always? WTF am I saying? How often do I write linked lists?) circular with a sentinel. When empty, the sentinel points to itself.
 
@FredOverflow thanks :-)
 
6:51 AM
@Managu No, I just thought you weren't aware of that useful feature, and I wanted to help.
 
@Managu No, don't worry, you did nothing wrong. He was just trying to show you a useful feature.
 
Sometimes us C++ loungers act nice. It seems to surprise people. I wonder why that is :)
 
@FredOverflow Oh, I see now. Thanks for pointing that out. I'm still used to an IRC mindset, I suppose.
 
@RMartinhoFernandes Well, I never write linked lists these days, so by logic, it is true that I always use self-referential sentinels, too, because there is not a single linked list that I wrote these days that didn't use self-referential sentinels :)
 
I wrote one some months back because Boost.Intrusive doesn't have move semantics yet :(
 
6:55 AM
still? :(
 
@FredOverflow A false statement implies any statement? Modus tolens should die!
 
Scratch that. Wrong axiom.
 
@Managu All I'm saying is that given an empty range, std::all_of will always return true, no matter what predicate you give to it (assuming it doesn't throw an exception, of course).
std::all_of(my_children.begin(), my_children.end(), smarter_than_einstein) => true
 
False!
[] () -> bool { throw 42; }
 
6:57 AM
@RMartinhoFernandes My thought exactly
 
I woke up two hours early. This means I can hang around some more in the lounge. Today is a good day.
 
Ha, I used to do that in my previous job. I would get up early as a safeguard against oversleeping and then just hang around here.
 
But I woke up by accident, I swear :)
@RMartinhoFernandes Wait a minute, it doesn't matter if the predicate throws or not, because it will never be called when the range is empty!
 
Dammit, my plan was foiled.
 
lol
 
7:01 AM
I shall take my revenge.
 
Well, .begin() and .end() could still throw... or does the standard forbid that?
 
-7
Q: Program to create a string which is used for a password

sumitghildiyalProgram to create a string which is used for a password,it have some properties ->any special character (except dot,semi colon,comma) is appear than remove it ->All character from A to Z must be appear in a string,if any of them is not in string than add it ->if any one is in small than change it...

Nuke please.
 
It not really std::all_of causing the fault then, though.
 
Also, I only used std::all_of because maths may not be as accessible (?) as C++.
What I really wanted to say was "All elements of the empty set satisfy any given predicate".
 
@FredOverflow I'm pretty sure that none of the standard containers can throw when asked for any of their random iterators. But I just assumed that my_children was a Banana<T> with weird .begin() and .end()
 
7:04 AM
Bananas!
 
@Managu The question is whether user-defined containers are allowed to throw in their begin and end methods. Maybe the standard has to say something about that, I don't know.
@RMartinhoFernandes Maybe a banana is a container of nutrients? :)
 
@FredOverflow What you really wanted to say was ∀x∈∅ ∀p∈PREDICATE: p(x)
 
Something like that, yes :)
 
@FredOverflow Fair enough. Not enough of a rules lawyer to know either. Though I'm having a tough time believing that the standard lays out any rules for what is or is not a "container".
 
7:07 AM
It certainly mandates the return types of begin and end. And when you dereference an iterator, you get a value_type. Stuff like that.
 
It's close to utterly useless, but it does.
 
Oh, I'll believe it talks about what is or is not an iterator. I still haven't figured out why an OutputIterator has a value_type of void. But container? shrug fair enough.
 
You know why C-derived language are so depressing? Because every function call statement ends with a sad smiley:
x.print();
        ^ see?
 
And Scala is much more fun, because it doesn't require the semicolons, hence no sad smileys.
 
7:09 AM
JavaScript doesn't require semicolons either.
Mwhahaha.
 
@FredOverflow Oh, I take it you prefer Haskell with all its crooked super sad smileys? >>=
 
But every JavaScript expert agrees that semicolon inference in JavaScript is way too dangerous. (Note that I'm only aware of one JavaScript expert, Douglas Crockford.)
 
@Managu Haskell is awesome!
 
@Managu I can only read basic smileese. What exactly does the smiley >>= depict?
 
I used this operator in Haskell once <^(:)^>
 
7:11 AM
@FredOverflow Mouth wide open, frowning, long droopy eyes? I dunno
 
(Well, technically, it's three operators, but it's as if it was one :P)
 
@RMartinhoFernandes I really liked the idea of Haskell. Until I figured out that monads really don't compose well at all. That sorta turned me off to Haskell. Since everything worth touching in Haskell is a monad of some sort or other.
 
How so?
Monads are all about composition.
 
Monads are about composing computations. What if I have a computation that needs to interact with two or three different monads? The answer is obvious. Throw it all into the IO monad and sort it out in comments.
 
when should i use "this" in C++ ?
or can i just use it inside a class to refer itself generally with no effect ?
 
7:14 AM
@Managu Have you looked at monad transformers?
Granted, the MTL is not the best :S
 
I tried to wrap my head around monad transformers. My conclusion was that you could basically "inherit" from a monad, and add behaviors and restrictions. But they didn't help you if you had more than a single monad. Consequently (almost) every monad worth using manages to be a transform of a transform of ... a transform of IO
 
@Abhishek as always - "when you need it"
 
@Abyx and how may i decide that i need it ?
 
@Abhishek by using your brains?
 
@RMartinhoFernandes Though I am willing to admit that maybe I didn't spend long enough trying to figure out how to use MTL and the like well.
 
7:16 AM
k :-)
was wondering if there are some guidelines
 
@Managu That's true. But once you build a transformer stack, it just works naturally as usual.
But yeah, they can be confusing.
@Abyx lol, who needs neurons when you have the Internet :P
 
@RMartinhoFernandes Say I start with Maybe 6. Then I want to foo: a->Maybe a, followed by bar: a->b followed by baz: b -> Maybe b. And then I Maybe want to output the result. What monad am I in? MaybeIO?
errm, MaybeIO b even
 
MaybeT IO b
 
Right. Ugh!
And elsewhere I'm running a parser in some sort of ParserT IO b. Now where am I? MaybeT ParserT IO b? Or is it ParserT MaybeT IO b?
 
That's where it gets complicated :)
Sometimes the order of transformers is irrelevant, at others it matters.
 
7:24 AM
It's been a while since I looked at this. But I think that was the theoretical issue behind the statement "monads don't compose well". Even with monad transformers.
 
The problem is that things like Maybe short-circuit the entire computation.
Where you put it in the stack affects what you get.
 
@RMartinhoFernandes What was the meaning of <^(:)^>?
 
Yeah. On a more conceptual level this means that (just as you say) monad transformers don't (necessarily) commute.
 
Right.
There are some alternative designs around, but none that gained lots of traction.
 
Which means ultimately (I think) that you have to commit to a complete transformer stack for every portion of your code -- before you create the code. Rather than having different pieces use different transformer stacks that suit them, and being able to put the pieces together at the end.
 
7:28 AM
The best strategy involves: minimizing the size of your stacks (i.e. don't use one stack to rule them all), and switching around at known spots.
This is basically what is known as separation of concerns.
Because you can always runSomethingT to reduce the entire stack to IO and then move along.
 
It's similar in flavor to the statement "mutexes don't compose well". To create code using multiple mutexes, you either contort yourself into knots, or you have some global concept of what order you take mutexes in, who can take them, etc. Or you have deadlocks
 
@FredOverflow Lift cons into an Applicative.
The <^ and ^> on the sides are "wings" that do the lifting.
 
@CatPlusPlus ¬_¬ what do you mean?
 
@RMartinhoFernandes but then, I'm probably talking out my ass at this point -- I think I'd really need to see more good quality Haskell code to know if my objection was fatal or if (as you suggest) there are reasonable established patterns which solve or work around my theoretical issue. Certainly I code with mutexes (i.e. in C++), despite not liking how they compose.
 
7:33 AM
@RMartinhoFernandes oh :(
 
hello ~
 
@Cicada trying out the new avatar again :(
 
@Managu Oh, I'm not saying it's perfect. But it's quite workable if you don't commit some capital sins :) Just like mutexes.
 
Though I'd dearly like to see a well established, mature, usable STM library for C++...
 
It doesn't check all those marks (particularly "well established"), but @jalf, one of the regulars here, has one.
 
7:36 AM
@RMartinhoFernandes Wings for lifting? That's so cute :)
 
I haven't even managed to sell my coworkers on C++ templates yet, despite the fact that we're supposed to be a C++ shop =/ I think "well established" would be even more important to me than "mature"...
 
@Managu Here: jalf.dk/blog/stm
@Managu Oh, that's sad :(
 
@RMartinhoFernandes I'll definitely take a look.
 
@Managu Using existing templates or writing your own templates? Writing C++ without using existing templates pretty much means writing C++ without using the standard library. Which would be insane.
 
@FredOverflow: writing templates in in-house code. Templates that someone else is responsible for maintaining are fine.
 
7:41 AM
Well, unless you're writing highly generic library code, not everything needs to be a template, really.
 
That is, std::vector<> is a go.
 
16 hours ago, by R. Martinho Fernandes
Modern C++: If something isn't a template, ask yourself, "why isn't this a template?" Then make it a template. #SeaPlusPlus
Template all the things.
 
@FredOverflow: no argument. In fact, nothing needs to be a template. But I don't really need wrenches in my toolkit if I've got a pair of pliars. Despite this, I do like using those wrenches sometimes...
 
@Managu your metaphor is confusing...
 
@thecoshman sorry. Maybe I should go to bed.
 
7:45 AM
what are the wrenches and pliers meant to symbolise?
 
No people, stop saying that. Everything needs to be a template. What is this? A nightmare? I'm slapping myself and nothing happens. It can't be...
 
@RMartinhoFernandes Huh?
 
can you do meta programming in template meta programming?
 
My analogy was meant to indicate: sometimes templates are a more appropriate tool to solve a particular problem than the alternatives (such as runtime polymorphism).
 
There are already enough non-template-y things on C++, namely int, bool, etc.
 
7:48 AM
@RMartinhoFernandes I know the urge to make everything a template, but that disallows separation into headers and implementation files, it slows the compilation down and can cause code bloat.
 
13 mins ago, by Managu
Though I'd dearly like to see a well established, mature, usable STM library for C++...
 
@RMartinhoFernandes @Managu My STM library certainly isn't mature or well-established... You'll have to ask @StackedCrooked if it's usable ;)
 
@RMartinhoFernandes Exclaimation on "well established"
 
@thecoshman Are you talking about a second level of meta?
 
@thecoshman Yes.
Quite limited, though.
 
7:49 AM
@Managu When possible, I always prefer templates to inheritance.
 
GHC has much more powerful meta-meta-facilities.
@FredOverflow Why are you trying to be rational. Just make templates and shut up :( Also, modules.
 
@RMartinhoFernandes Nobody knows what modules are supposed to be, yet.
 
I do.
They're supposed to be great.
 
Observer pattern without dynamic function dispatch? I'm sure it's possible. How?
 
As long as each subject only has one kind of observer: templates
 
7:53 AM
Well, yes. Go on. How do I register an observer?
 
template<typename Observer>
class Subject
{
    std::vector<Observer*> observers;
public:
    void register(Observer* observer) { observers.push_back(observer); }
    // ...
};
 
You're using inheritance!
 
No I don't. Observer is a template parameter, not a polymorphic base class.
 
@FredOverflow Sounds like voyeurism
 
Reminds me of boost.signals.
 
7:55 AM
Oh wait, you mean Subject is a base class?
You can inherit privately and then re-export (or whatever the term is) the register method to clients.
Or instead of Subject, you call it Event, and then just have Event data members instead of inheriting from them.
 
So, then, to string up a GUI, say. I would have a Button<MyController, &MyController::button_clicked> and a TextField<MyController,&MyController::text_changed,&MyController::got_focus,&My‌​Controller::...> or some such?
 
Holy crap, what.
 
Oh sorry, those should all be MyView. But it's really a MyView<MyController,...>
 
Holy crap, you don't have to use template parameters to manage unknown types
 
Well, stringing up a GUI is the classic use for the observer pattern, no?
 

« first day (635 days earlier)      last day (4310 days later) »