« first day (997 days earlier)      last day (3952 days later) » 

10:00 AM
oh god
 
user784668
@BartekBanachewicz oh C FTFY
 
oh <windows.h> FTFY
this header is a unfunny joke
"let's include last 20 years of total crap instead of dividing it somehow"
seriously if someone tells me microsoft is good at that software thingy again I'll punch em in the face
 
user784668
More like, "let's include last 20 years of total crap because if we tried to make it better important programs would stop working".
 
user784668
And I mean working, not just compiling.
 
What went wrong? VS wrapped the API in an 'unusual and challenging' manner?
 
JBL
10:04 AM
Basically the reasons we "deprecate" things instead of deleting them... :/
 
@Fanael you could still have a 'legacy' windows.h for what currently exists, but develop a cleaner header for newer programs to use.
 
user784668
And therefore duplicate effort, making maintenance a mess.
 
user784668
Hysterical raisins everywhere.
 
user784668
And always making everything hard.
 
can i get a second opinion? stackoverflow.com/questions/17479427/…
 
10:08 AM
@willj First two sentences seem to have something messed up. (compare uses of collidable and uses of collidable_object)
 
JBL
Blergh, trying to find out how was implemented the C lib in C++, I'm not too sure I'm happy of having opened cstdlib..
 
@Fanael meh, Khronos was able to make gl3.h
@JBL run!
 
JBL
@BartekBanachewicz Hey that's interesting at least
 
@R.MartinhoFernandes That's just C++ being messed up ;)
 
@willj Erm, no.
The first paragraph seems to refer to a different set of classes from the second one.
It's not C++, it's your writeup.
 
JBL
10:10 AM
It answers to the question I was asking myself "C features written in C++ or just a wrapper ?".
Welp...
 
@R.MartinhoFernandes you may have a point, let me double check
 
Oh, sorry, above I meant "first two paragraphs", not "first two sentences"
 
JBL
Robot just had a bug.
 
oops, the template argument list was on the wrong side in the second paragraph
thanks!
 
10:18 AM
lol /cc @Xeo
 
You almost earned the "good comment" badge!
 
that one's even better :D
 
Xeo
@AndyProwl Hrhr :D
 
> The one man that could've gotten away with calling Samuel L. Jackson a nigga. Wasted.Don't get me wrong though I love the man, but you can't throw away opportunities like that.
 
10:21 AM
Aand there you have it
 
apparently SLJ earned 7.42 billion dollars throughout his career
damn does he even code? :<
 
Well my tests work
But I have to check them in now. :effort:
 
user784668
@TonyTheLion that's because they're incomplete
 
JBL
Who tests the tests ?
 
the tester
 
10:23 AM
std::conditional<
   std::is_same<something, other>::value,
   std::true_type,
   std::false_type
>::type;
 
what?
 
isn’t this the same as std::is_same<something, other>::type?
 
@KonradRudolph yes
 
@KonradRudolph Oh gawd what.
 
hmm. This makes me trust the answer much less …
 
10:24 AM
That's the TMP equivalent of x == y? true : false :'(
Who the heck.
 
2
A: Check if a class has a member function of a given signature

jrokHere's a possible implementation relying on C++11 features. It correctly detects the function even if it's inherited (unlike the solution in the accepted answer, as Mike Kinghan observes in his answer). The function this snippet tests for is called serialize: #include <type_traits> // Primary ...

 
OH FFS
The title is enough for me.
 
std::conditional<
           std::is_same<
               decltype( std::declval<T>().serialize( std::declval<Args>()... ) ),
               Ret    // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           >::value,  // attempt to call it and see if the return type is correct
           std::true_type,
           std::false_type
       >::type;
that's the actual code
@R.MartinhoFernandes true.dat
 
JBL
Do my eyes fail me or is this guy asking for some kind of reflection in C++ ?
 
user784668
@JBL yes
 
10:27 AM
oh gawd
 
another one, huh?
 
bad questions are terrible
 
I don't get those people.
@TonyTheLion at least you can downvote that question. OTOH, you can't downvote ThePhd
 
ThePhD is beyond downvoting, he needs a punch in the face or something.
 
I still have that cowboy_cast in my mind
 
10:28 AM
crap
I told you to look away
 
It's the best answer though.
 
user784668
@AndyProwl WTF?
 
oh man
 
It's the only one that does a decent test.
 
@BartekBanachewicz I should have listened
 
10:29 AM
The rest are crap because they are inspecting the function signatures.
 
brain bleach
 
JBL
Is ThePhd still taking fire for that famous pull request ?
 
CAPITALIST PIGS
 
no
cowboy_cast
 
JBL
Meh.
 
10:30 AM
@Crowz oh hey commie
 
@Crowz is that a pun?
 
JBL
Capigtalist.
 
I dunno I'm just being edgy
 
JBL
There, shorter.
 
10:30 AM
@Crowz Are you a commie mutant traitor, citizen?
 
does python have lists of list?
 
I am not starting another discussion about capitalism.
 
@Crowz [[]]
 
@Crowz does your browser have search bar?
 
Google
 
10:31 AM
@Crowz No, like Perl, it only has lists of non-lists.
 
what?
 
hahahhaha still funny.
@TonyTheLion The bit about Perl is true. It's just not true that Python copies that.
 
ah right
 
@BartekBanachewicz how should he know, he'd have to search for it first ...
 
:effort:
 
user784668
10:32 AM
@R.MartinhoFernandes lol Perl?
 
(╯°□°)╯︵ ┻━┻)
 
@R.MartinhoFernandes Added that to my "Why I don't want to touch Perl, ever"
 
Perl 5 added references to lists of references to "overcome" this.
 
user784668
lol
 
user784668
10:37 AM
 
Features

Readable:
Stopped reading,
 
user784668
> Concise: use + and - to set static or instance methods, \ for private, | for protected, / for public
 
user784668
ahahahaha
 
What a joke.
 
user784668
Oh, it is a joke.
 
10:44 AM
@StackedCrooked are you by any chance able to to bump the timeout on stackedcrooked for a spirit sample? I'm behind proxies and doing it will be a pain, I envision
 
@KonradRudolph I didn't even know std::is_same has got a member typedef. Now that I know, it's indeed a bit verbose :)
 
man, anyone familiar with flask?
 
@StackedCrooked n.m. I got it to work
 
@jrok Oh, good that you’re here. Say, do you know how to modify your code so that instead of a fixed signature, the return type is obtained from a nested type in C?
@jrok In particular, I want to test whether the type has a member C::size_type size() const … and I’m stumbling over the test for the signature.
(The problem is that not all tested types are going to have a C::size_type to begin with)
 
> We all love PHP's power. Easy to use
stopped reading.
anyway its syntax is much better than PHP
 
10:49 AM
@KonradRudolph You can make it std::is_same<typename C::size_type, decltype(...)> and it works.
 
if I am ever in my life forced to write php, I'd probably use that thing
 
(I'd prefer is_convertible, though)
 
@R.MartinhoFernandes won't that error out when there's no size_type in C?
 
I don't know what he was smoking WRT public/private and static
 
@jrok No, it is a substitution failure, just like if the expression in decltype is not valid.
@BartekBanachewicz Go home, you're drunk.
 
10:50 AM
@R.MartinhoFernandes ah, yes, indeed.
 
@StackedCrooked Coliru still can't handle Spirit :(
0
A: How can I extend a boost spirit grammar

seheI'd not complicate matters by inheriting. Composition is often more than enough, and it won't confuse the qi parser interface. I've drawn up a small sketch of how a versioning grammar could be done. Assume the old grammar: template <typename It, typename Skipper> struct OldGrammar : qi::grammar<...

 
Too much orange on the starboard.
 
@R.MartinhoFernandes Nope, typename C::size_type doesn’t exist in all types C that I want to test on
:(
 
You want blue links?
 
scratch taht
 
10:54 AM
@KonradRudolph So what.
 
@R.MartinhoFernandes So SFINAE doesn’t work, and compilation fails. But typename T::size_type works of course
 
Why doesn't it work?
 
> error: no type named 'size_type' in 'struct foo'
 
Oh, C is a different template parameter.
 
10:57 AM
I thought you were just being lenient with the variables.
 
I’m being lentil with the vegetables
 
Make it template<typename T, typename C2 = C> then and typename C2::size_type.
 
Why? Using T::size_type is enough, no?
it seems to work
 
Oh, it's the same type. Right.
Dammit, I got really confused.
I thought there were two types involved.
 
@ScottW also, old hat. At least twice a week, this "trick" gets hyped on SO
 

« first day (997 days earlier)      last day (3952 days later) »