« first day (837 days earlier)      last day (4115 days later) » 

1:00 PM
@FredOverflow is it from Lost?
 
@FredOverflow Have you see this?
A conversation between Rich Hickey and Steve Yegge!
 
@BartekBanachewicz Yes.
@StackedCrooked Sounds like a dumb idea.
 
@BartekBanachewicz It's a lost foot.
Dumb? :(
That would mean I'm dumb as well.
Actually, that goes without saying.
lol
This whole Cojure thing is like a girly gossip party.
 
> If you have half an hour, watch a compelling vision of what software development will look like in 2010.
@StackedCrooked Damn, 3 years late :(
 
fuck me
it's hard to know what the current state of Ranges is
shitty mailing list.
 
1:12 PM
@DeadMG I've given up on reading it
too.. much.. mails.. can't read all..
 
they should have an interface like the normal library proposals/discussions.
that would at least be somewhat usable.
 
@DeadMG It ranges somewhere between nothing and complete.
Mailing lists are generally shitty.
I'm like a normal human now :D
 
@FredOverflow is that this guy's foot?
 
1:19 PM
@melak47 It's an abomination!
 
@melak47 Well, what does it look like to you? :)
 
@FredOverflow It looks like a foot from any guy.
 
@StackedCrooked And that's exactly what it is :)
 
@StackedCrooked lies, those are not curtains, they are blinds
 
@StackedCrooked any 4 toed guy
 
1:21 PM
> too many template headers for annex::name_of<{anonymous}::foo>::value (should be 0)
First time I see this error I think.
 
Xeo
lol
 
fucking C++ and it's literals
string [] = { "a", "b" "c" }; <- forget the comma, you're screwed
 
@thecoshman The curtains are not visible in this picture. I have blinds also, but much more curtains than blinds.
 
@BartekBanachewicz Why would you forget a comma?
 
@melak47 Now don't be brilliant.
 
1:24 PM
@StackedCrooked why you lie!?
 
Also, did you know that { "a", "b", "c", } is valid? :)
 
@FredOverflow Intellisense didn't underline that, but I refuse to believe
 
@FredOverflow valid what?
 
Array initializers can have a trailing comma to make writing code generators easier.
 
@melak47 C++
 
1:25 PM
I had a piece of code like: {
"a",
"b"
// second section
"c",
"d"
 
@FredOverflow This was not a trivial change. In fact, it changed the entire message.
 
int a, b,;
 
@R.MartinhoFernandes well, it's also valid Lua.
 
@LucDanton Beat that :P
 
@R.MartinhoFernandes STOP PINGING ME WITH TRIVIAL CHANGES
 
Xeo
1:26 PM
@FredOverflow Now you're just asking for it.
 
auto a = 42, b = "answer";   // I always forget if this is valid C++11
 
I've felt pretty shitty all day but this has been good medicine. tl;dr lol.
 
Xeo
@FredOverflow No
 
Why would you use auto when you can use pointers ?
 
1:27 PM
> error: inconsistent deduction for ‘auto’: ‘int’ and then ‘const char*’
@ereOn That question doesn't make any sense.
 
This thing has grown to gigantic proportions :|
 
@R.MartinhoFernandes Viagra?
 
@FredOverflow Why would my questions make sense when I can use pointers instead ?
 
@FredOverflow with yeast
 
@FredOverflow An answer I have been writing in bursts since this morning.
It's now at 7.88kB.
 
1:29 PM
@R.MartinhoFernandes Bursty huh..
 
Yeah, I know that feel.
 
@R.MartinhoFernandes link?
 
@FredOverflow It's not published yet. I will link when I'm done.
 
Xeo
@R.MartinhoFernandes The enable_if one?
 
Xeo
1:29 PM
Make it an article and link that as an answer.
 
I want to put and end to this matter ;)
 
@R.MartinhoFernandes k=1000 or k=1024?
 
Xeo
7.8KB is.. woa.
 
@Xeo Yeah, might be better, but then I also need to write a summary to put in the answer...
 
So, I'm once again trying to associate names with types, and I'm once against hitting my head against the wall. Is there no way out of this?
Or names as tags, really.
 
1:32 PM
What do you mean? No good naming ideas? Or "associate names with types" means something in C++?
@LucDanton Oh, like you did with get<some_name>?
 
@R.MartinhoFernandes I revisited this and I thought I should separate the tag types from the rest. The former is compact and okayish.
 
If I want something like std::cout << name_of<my_tag>::value though it gets terrible quickly.
 
Xeo
Should name_of<X>::value be a compile-time constant?
 
@Xeo No. The tag types should be enough for compile-time.
 
Xeo
1:36 PM
Mhm. Also, why not use overloading?
 
It doesn't need to take the form of a static data member, too. It's the first idea I attempted. Perhaps name_of<my_tag>() is worth investigating.
 
10 lashes for A's author for not providing a non-throwing swap(A, A) overload — rhalbersma 3 hours ago
lol
 
I'm going to pastebin what I wrote so far so you guys can look at it if you are curious pastebin.com/WwPJSh21. There may be some weird disconnects since I have been jumping between work and writing the answer and haven't cared about polish yet.
 
That awkward moment when you write a macro that's identical (name and behaviour) with the one exisiting in the framework.
 
Xeo
1:39 PM
> That awkward moment when you write a macro
@FredOverflow Remove the space after "Status"
 
@Xeo #define ARRAY_COUNT(a) (sizeof(a) / sizeof(a[0])) can you forgive me now?
 
Xeo
@BartekBanachewicz No
 
duh.
Remember that C++11 toolchain is still being set up
 
Xeo
1:42 PM
template<class T, std::size_t N> constexpr std::size_t length_of(T(&)[N]){ return N; }
 
@BartekBanachewicz no... If you are going to make array sizeof macros, at least make them properly
 
Xeo
And even before that...
 
constexpr, ahahaha
maybe in VSNext
 
Xeo
@BartekBanachewicz There are other ways.
 
@BartekBanachewicz Completely optional.
 
1:43 PM
you don't need constexpr for an implementation like that to work
 
I think I should find the guy who wrote the original one.
 
@R.MartinhoFernandes It's already included as "Prefer pass-by-ref-to-const to pass-by-value for std::shared_ptrs."
 
@R.MartinhoFernandes I'm leaning towards the same opinion as Xeo here: knowing how the techniques differ in their respective goals may be necessary to answer the question, but such an explanation doesn't feel like it belongs in the answer. For instance considering tag dispatching isn't even mentioned in the Q.
 
@StackedCrooked Yeah, but it's wrong.
 
1:44 PM
Oh gawd, again.
 
Xeo
template<class T, std::size_t N>
char (&length_of(T(&)[N]))[N];
#define ARRAY_COUNT(a) sizeof(length_of(a))
@BartekBanachewicz ^ something like that
 
44
A: Passing shared pointers as arguments

R. Martinho Fernandes I want to pass a shared pointer to a function. Tell me how to do that. I can only think of two reasons to take a shared_ptr argument: The function wants to share ownership of the object; The function does some operation that works specifically on shared_ptrs. Which one are you interested...

 
I apologize. I did no see this post before.
 
@Xeo thanks. Can I rewrite std::begin and std::end in C++03 too? They don't seem too complex. (I'm not going to put them in std)
 
@StackedCrooked It's ok.
 
Xeo
1:46 PM
@BartekBanachewicz Not with all the nice features. Do you have decltype?
 
I'm getting tired. Did I mention writing can be tiresome as heck?
 
@Xeo is decltype C++03? I have 5 build targets (x2, because x64) -.-
 
@BartekBanachewicz Overloads for arrays: gist.github.com/3959946 Just add ones that call the members and viola.
 
@BartekBanachewicz basically, it's just a global function template which calls x.begin() or x.end(), and then a specialization for raw arrays, which does differently. There are a few nuances that'll be hard to get, but you can get 95% of the way easily
 
are you still writing an answer to that question from earlier?
 
Xeo
1:47 PM
@BartekBanachewicz No.
 
@Xeo that's what I thought.
 
Writing is difficult. I suck at it. @jalf seems like a natural talent though :)
 
10
Q: Reliably determine the number of elements in an array

FredOverflowEvery C programmer can determine the number of elements in an array with this well-known macro: #define NUM_ELEMS(a) (sizeof(a)/sizeof 0[a]) Here is a typical use case: int numbers[] = {2, 3, 5, 7, 11, 13, 17, 19}; printf("%lu\n", NUM_ELEMS(numbers)); // 8, as expected However, not...

 
Xeo
Sounded like you were using VS2010 atleast. :)
 
user142019
Man.
 
1:48 PM
2012, but compiling under 2k10 on windows, gcc 4.4 on linux, clang whoever-knows-which on mac and gcc 4.7 on android.
 
Xeo
@FredOverflow The answers to that question suck. oO
 
@StackedCrooked I used to write prose fiction when I was in high-school, and I remember it being exactly the opposite of tiresome :/ Technical writing is a whole other beast.
 
Xeo
@BartekBanachewicz Hm, GCC 4.4 has typeof, so that might work. :D
 
@BartekBanachewicz All of the above have decltype.
 
@Xeo I like my 4th subquestion :)
 
1:49 PM
@Zoidberg Men
 
@Xeo See tags.
 
@DeadMG I'll run a quick test to QuickBuild and just check, that will be faster. Problem is, they are all set up without -std=c++11
 
I think I need a vacation from nominative typing.
 
Xeo
Oh, C.
 
@LucDanton hehe. Back to OCaml? Or some dynamic thingy?
 
user142019
1:50 PM
STUPID LAG FUCK YOU DUTCH RAILWAYS
 
@Xeo Yes. Remember that in late September/early October, my brain is in C mode.
@Zoidberg How was the Java test?
 
@R.MartinhoFernandes I would like to keep it statically-typed, I don't think I have much to learn from dynamic typing in those areas.
 
:7451375
Fyra?
 
user142019
@FredOverflow damn easy.
 
user142019
There was even a mistake in it.
 
1:51 PM
@Zoidberg Care to elaborate?
@Zoidberg Only one? :)
 
@StackedCrooked what
 
user142019
@FredOverflow Well, one real error. :P
 
Xeo
I think I have to ask again: Why the fuck do you care for the test?
 
Man, I can already imagine myself lying in bed with Effective C++11, having a great evening.
 
@FredOverflow It was using Java
 
1:52 PM
@jalf Is there something about the grammar of the spelling that you don't understand? :)
 
@FredOverflow some people imagine their "great evenings in bed" with different activities :)
 
@CatPlusPlus You can only make one error in Java?
 
Yes, but it's always fatal
 
@jalf That'll have to wait then :)
 
@Xeo Kid's crazy.
 
user142019
1:52 PM
Class Test (what a name) had a static data member foo, which was accessed as a non-static data member (i.e. on an object).
 
@StackedCrooked no, more the meaning. I'm a natural talent?
 
@CatPlusPlus Oh wait, now I get it.
@Zoidberg You can do that in Java. Eclipse will warn you that it is bad style and potentially confusing, but it's possible.
 
@Zoidberg did you point it out?
 
@jalf Yeah, like reading Accelerated C++ for the first time!
 
@jalf Yes, and I'm an artificial talent.
 
Xeo
1:53 PM
Man, I really have adapted to Esc being on my capslock key. I miss it at home, since I never restart there so the registry entry doesn't take effect.
 
user142019
@FredOverflow really? What a terribly shitty language.
 
ugh, life would be so much simpler if testers were not allowed to go around reopening your bugs after you resolved them
 
user142019
Anyway, then I checked the right answer. :P
 
@Zoidberg That's fine
 
Xeo
@Zoidberg C++ can do that too...
 
1:54 PM
@Xeo hehe. I know that feeling. "WTF why is Caps Lock on? I thought I got r-- oh."
 
user142019
Yay I scored 10/10.
 
user142019
That makes no sense. .-.
 
user142019
@Xeo wat.
 
@Zoidberg yes
 
user142019
Why is the world using shitty languages.
 
1:54 PM
C# allows that too.
 
Xeo
I actually like that, I can do str.npos instead of std::string::npos. :)
 
user142019
ITT: shitty languages inherit shitty rules from other shitty languages.
 
@LucDanton Go?
 
@Zoidberg Okay, what else was in it?
 
@R.MartinhoFernandes lol
 
1:55 PM
@Xeo Hey, that saves a ton of typing!
 
Dunno, maybe I'll read some more papers on record systems.
 
@Xeo Does it also work with types? Like str::iterator? :)
 
@LucDanton What's funny? It's statically typed and has some kind of structural typing-ish thingy.
 
Xeo
@FredOverflow lol, no
 
@R.MartinhoFernandes Yeah, and there's the rest. It's not bad, but it's not interesting.
 
user142019
1:56 PM
@FredOverflow Interfaces, "encapsulation", inheritance, polymorphism, downcasting, "good OO i.e. getters and setters for everything", abstract classes, abstract methods, variables, data members, static. I think that's about it.
 
user142019
I got the test right here. You could take it with you. (Not the answers, obviously.)
 
@Xeo I like it because it lets me write range.empty() everywhere, and then for (statically) infinite ranges I can make that a constexpr static and make an is_infinite trait out of it.
 
@R.MartinhoFernandes Also the structural thing still requires you to write some types nominally (I dunno how to phrase that right).
 
@Zoidberg Language? French?
 
Xeo
@R.MartinhoFernandes Heh
 
1:57 PM
@LucDanton I know what you meant.
 
user142019
@FredOverflow Dutch, of course.
 
user142019
But with English terminology (thank God).
 
I don't think I'd understand any of it.
 
user142019
Non-English terminology in programming world is silly.
 
Going to check out some wheels as a break.
 
user784668
1:58 PM
@Zoidberg So a test about stupid programming?
 
@Zoidberg Why would it be disallowed
 
@Zoidberg png?
 
user142019
@Fanael I think so.
 
It's reusing type information
 
@R.MartinhoFernandes Did I mention I like your freehand wheel?
 
1:59 PM
You can call static methods on objects too
 
@LucDanton Not yet, but you are not the first one.
 
There's no reason to disallow it
 
user142019
@FredOverflow paper and ink.
 
well, t.static_thing is no different to decltype(t)::static_thing
and I agree with Cat- flexibility is le gud.
 

« first day (837 days earlier)      last day (4115 days later) »