Conversation started Jul 9, 2015 at 9:00.
Jul 9, 2015 09:00
any good naming convention for function pointer typedef? I was going to add Proc at the end of the type like typedef void (*sendmsgProc)() , any better idea?
It's probably true that they do, it just fails the Bechdel Test by having it be about Aragorn
@AlexM. maybe it meant important female characters
@ecerulm Use std::function<>
user1804599
@StackedCrooked nice
well I should have made the question in the C chat room, because it's really a C project
Jul 9, 2015 09:01
using SendFunction = void (*)();
user1804599
use templates
user1804599
function pointers are not sufficiently polymorphic
@ecerulm yeah you should
@rightfold the function pointer can point to a function template instantiation
Experimented with bitmasked template a while ago. It's here at line 227.
Generates object code for multiple branch combinations so they become static branches.
ok, but is there any good / popular convention naming for std::function<> variables then? Google std::function<> I found an example using f_ prefix on the variable name, is that the "popular" choice?
Jul 9, 2015 09:08
Probably should be careful with the exponential object code growth though.
@ecerulm Whatever makes sense as a name, it's a non-static member variable just like std::string or w/e
why would you prefix std::functions using f_, you already know they're std::functions so they're function objects
@ecerulm use a name that makes sense.
you don't prefix ints with i_, right?
If it's a callback I sometimes name it callback .
4
user1804599
Jul 9, 2015 09:09
@ecerulm the popular choice is to avoid hungarian notation like the plague.
I use er at the end
e.g. comparer
searcher
etc.
Just checking if there was a de facto convention already. The f_ thing comes from the std::function<> example at cppreference.com
@AlexM. of course I do. Who doesn't?
aka hungarian notation is the best
@FlorianMargaine inb4 flag
if it's a callback I may say something like
on<Something>Callback
on may or may not be there
@FlorianMargaine :O
Jul 9, 2015 09:11
@FlorianMargaine moldavian notation is better.
I like transylvanian notation
@AlexM. camelCase! Found the Java programmer
thanks @AlexM.,@StackedCrooked , those are actually relevant to what I was onto.
 
Conversation ended Jul 9, 2015 at 9:11.