« first day (877 days earlier)      last day (4070 days later) » 

Ell
7:02 PM
/*
 * unused variables
 */
(VOID)(param);
(VOID)(pkt_data);
^what is the point in this?
 
@Ell oh lol
@Ell probably C shit
 
@Ell Not getting warnings.
 
C != shit
 
@Ell VOID? no *??
 
Ell
Correct
It is c shit I think
 
7:04 PM
@EtiennedeMartel Ya.
 
@BartekBanachewicz I agree.
 
Ell
I want to accept a callback that will be passed to a c function, this means it must be able to cast to a function pointer - how should I accept this in a function? Just make it a template? or accept an std::function? The latter doesn't seem like proper use of std::function
meh I'll google it too :P
 
@EtiennedeMartel Unless you really need a vector (e.g., you're depending on contiguous storage) I'd switch to a std::deque, and use push_front.
 
I have just made Ambrosia build the flac executable.
hell yeah.
 
@Ell I'd generally avoid std::function as part of an interface. If you just want something that can be invoked like a function, make it a template parameter.
 
7:08 PM
@Ell Does the C function allows you to pass void* userdata argument
 
Ell
@CatPlusPlus I don't think so :/
But say it did, then what?
 
BWAAAAAAAAH.
 
If it does, then you write a dispatcher function and pass std::function object as that userdata argument, and call it in the dispatcher function
It's easy and self-contained
If it doesn't, then just take a function pointer in your interface because you're dealing with shit library
And using std::function would require creating dynamic thunks or using global state
 
Xeo
@nneonneo: Sorry buddy, but your answer invokes undefined behaviour. You can't just cast however you want to.
 
Unless you want that mess then go ahead and write that machinery first
 
7:14 PM
Or you can rewrite the shit library and do yourself and the planet a favour.
Or just give up and go into botany.
 
Botany sounds like more fun.
 
user image
10
Oh geeze -- I've been hanging out in the Lounge too much.
 
666 <3
 
Xeo
@JerryCoffin Woah, that one must be old.
 
@Xeo Brand new today (and barely Photoshopped at all).
 
7:17 PM
@JerryCoffin y not javascript: document.body.contentEditable = true; ?
 
Xeo
Oh, yeah, the badges couldn't be from that early. :P
 
@DomagojPandža Because javascript.
 
@JerryCoffin ten gold ones. Wow.
 
@JerryCoffin Agreed.
Damn, my renderer is so damn efficient. Although I'd kill 10 baby seals for OGLES 3.0 and MRTs on phones.
 
@rubenvb That's actually fairly low compared to quite a few (most?) people who've spent as much time on SO as I have.
 
7:20 PM
@JerryCoffin I have to ask, where do you find the will to answer questions? :D
 
@JerryCoffin well, I only have one.
Either I suck or I don't take it seriously enough :P
 
Hmmm, I have these questions about templates?
 
@DomagojPandža I dunno exactly. Answered a lot for years on Usenet before SO came along, so I've been doing it a lot longer than may be immediately apparent.
@rubenvb I wouldn't say it's exactly as seriousness (something to which I'm allergic).
 
Xeo
@TonyTheLion decltype(f)::type :)
 
@Xeo and what about that standard quote, what the hell is a non-type parameter declaration?
 
Xeo
7:23 PM
I have no idea what it even is that you're asking. :<
 
@DomagojPandža hey that's nice
 
Xeo
@TonyTheLion Just what you have, <int N>
 
@Xeo ah, so it's not the typedef typename T::type type;?
 
Xeo
That one is a type
 
because that is a qualified-id afaik, right? (T::type)
 
Xeo
7:24 PM
Yea
 
> typename followed by a qualified-id denotes the type in a non-type 136 parameter-declaration. (14.1)
 
Xeo
Ah
 
typename T::something <--- typename followed by qualified-id, right?
 
Xeo
Compiler has to assume T::type is a non-type.
With typename T::type, it assumes a type
 
@BartekBanachewicz Don't use it for malicious purposes. Actually, do. That's the best use. :D We once spoofed a big news network website to say that the police is looking for our buddy who endangered traffic (which he did, not much though, we made sure to blow it out of proportion).
He almost had a heartattack. :D
 
7:26 PM
@Xeo ah, I see. Now it makes sense
Thanks Xeo
 
Soon to have: mac builds of my toolchains
how: don't ask
times I have claimed this capability: 3
times I actually succeeded: 0
 
Also, the only way for my rep to increase beyond 1.5k ahahah
 
I was stuck at a thousand something rep for quite a long time
then I decided to start repwhoring, and bit by bit, it came up
over the last 2.5 years or so
 
I don't know, I admire you guys for trying to answer questions, I feel like every answered question is time wasted that could've been code. :D
 
learned a lot from answering questions
 
7:31 PM
me too.
I asked a lot of questions as well.
 
@DomagojPandža for me it's about learning new stuff through answering questions
 
Ell
Has someone here used boost::asio before?
 
@TonyTheLion That's something I try telling myself, but I'll need a bit more self-convincing. It's nice to share also and be part of a community.
 
yep
@Ell yes
 
@DomagojPandža all you do is waste bandwidth and nag about it.
:P
 
Ell
7:33 PM
@TonyTheLion Heh just realised my question wasn't valid xD Was going to ask about why they choose to pass an error parameter instead of throwing an exception, but then I realised my thing isn't async :3
 
async exceptions ftw
 
They'll bite you in the ass... At some unspecified time in the future.
 
@Ell I don't see the relation between throwing an error or exception and async?
 
Ell
Meh. Nor do I now
Everything I know disappears when I think about async
Oh I remember, if a function is non-blocking then you can't throw an exception
 
@JerryCoffin Holy shit. How long ago was that?
 
7:37 PM
@Mysticial Dear Google Employee #31415, what 666 rep user has 10 gold stars? :P
 
@DomagojPandža You have a point there...
fucking shopped.
 
Xeo
You could've just read 2 lines further
@DomagojPandža Dear random guy: What SO user has gold stars? :P
 
@Xeo which I didn't. :)
 
I have a lot of gold stars
 
Oh, wait. Stars. Dammit!
Nice badge, officer. Nice badge.
 
7:40 PM
template<typename T> void foo(){} is T here a non-type template parameter?
 
Tony, scouring the standard as usual? :D
 
template<int N> foo this is non-type template param right?
 
user142019
@TonyTheLion It says "typename". Now try again.
 
7:42 PM
@DomagojPandža It's actually quite interesting once you get into it
 
Let's play OpenTTD I completely suck at it
 
Bling.
 
Ell
What time for a timestamp? I'm guessing std::chrono::time_point<std::chrono::system_clock>? I'll look into it. Chip in if you can be bothered
 
@Ell time_t?
 
Ell
time_t? That looks like c to me xD
 
Xeo
7:46 PM
0
A: Call lambda without binding it to an identifier

user1233963I seem to have come up with a solution of my own: #include <iostream> int main() { std::cout<<"Main\n"; [&](){ std::cout<<"Hello!\n"; (&main+13)(); }(); } First call to cout is present just to show that it's not calling main. I came ...

Omg
 
Don't use time_t
 
@CatPlusPlus why not?
 
You want to keep timezone information with your stamp at all times
 
oh
 
@TonyTheLion A non-type parameter would be like template <int N> ...
 
7:48 PM
Date/time processing is ridiculous and approaches Unicode levels of complexity
 
Then what's the alternative to time_t?
 
Xeo
@LucDanton: Richard Smith was one step ahead of us. :<
 
@JerryCoffin so what's a type-parameter then?
 
Xeo
He knew what I wanted to ask him purely based on GCC's error message.
 
@Xeo Hee hee, I'm not surprised.
 
@CatPlusPlus No, not usually. Usually you want to store UTC (or something on that order) and only convert to a local time on demand.
 
Ell
Hmm wait a second. It looks like the timestamp is held as a timeval struct, so a time interval
 
@Xeo lol
 
@TonyTheLion A normal template parameter like template <class T>...
 
@JerryCoffin Yeah but how do you know which timestamps are UTC and which are local
Types are there for a reason, use them
 
7:49 PM
@CatPlusPlus Simple -- they're all UTC. You only convert to local for things like display.
 
Xeo
> In addition, this rewrite adds the restriction that lambda expressions cannot be used in the operand of a sizeof operator, alignof operator, or decltype specifier. That restriction— suggested by Doug Gregor and John Spicer—avoids severe implementation difficulties with template argument deduction (e.g., this avoids the need to encode arbitrary statement sequences in mangled names).
 
At the very least you want a strongly typed wrapper over time_t that stores timezone
@JerryCoffin Yeah unless they're not because someone else assumed something else
I've had that happen recently, it's fucking hell to debug
 
@JerryCoffin but but, the standard speaks of type-parameter different to template-parameter and different to non-type template parameter (if you look 14.1.3), perhaps it's using some of these terms interchangeably?
 
user1182183
I'm really surprised that I see so much C++ talk here
 
Timestamp without timezone information shouldn't ever exist
 
7:52 PM
@Xeo FTR, although I'm sure you're aware, we only care about SFINAE here. We don't have to have a lambda in the signature. (Although of course compilers are reluctant to SFINAE on default function parameters so we're possibly out of bullets right now.)
 
@TonyTheLion A type-parameter is class T or typename T, a non-type parameter is int N, size_t X, etc., and a template-parameter is either one.
 
class T {}; template<typename U, T i> class foo {}; apparently T is a type parameter here, per 14.1.3? I would have said non-type template param, but who am I?
@JerryCoffin ah, I see.
 
Fuck you, Visual Studio.
 
Oh um, I guess we can try the template parameter list next.
 
user1182183
@EtiennedeMartel I have no one to fuck so I fuck VS too yeah ; o
 
7:53 PM
Why is my Internet crawling
 
Xeo
@LucDanton Well, that one already works for Clang. Now I just need to confirm if it's well-formed. :)
 
user1182183
@CatPlusPlus Run when you can, walk when you have to, crawl if you must, just never give up
 
user1182183
your internet is not giving up on you, be happy
 
Nice of you to do all that gruntwork.
 
@CatPlusPlus Crawling in your skin?
 
Xeo
7:54 PM
lol
Get your ass into #llvm :P
> [20:54:23] <zygoloid> question is, if i have: template<typename T> void f(int [0 && ([]{}(),0)]); twice in my program, are they the same function?
 
@Xeo wot
 
Xeo
OH C'MON! Why the fuck does LWS never load for me when I create a new snippet...
 
@Xeo I'm pretty sure you can cast function pointers around
 
LWS sucks
 
Xeo
@nneonneo You can't invoke them with the wrong type, though
 
7:59 PM
I invoked it with another function pointer...
 
@Xeo huh
 

« first day (877 days earlier)      last day (4070 days later) »