I obviously cannot know some of the deeper Signals implications as well as you; however, from my perspective as a user, either '4' or '5' seem preferable.
I could even like '2' if the first argument was a strongly-typed enum instead of a 'constexpr char *'. (Efficiency aside, the strings in '1' & '2' just don't feel very C++ & that bugs me. Granted, I don't load any parameters from text files.)
If I had to choose between '4' & '5', I suppose I would have a very minor preference for '5', only because it reads well as english in your example.
And, while you're breaking interfaces and I'm being OCD, would you consider changing 'connect()' to 'assign()'?
Or better yet, for '4', you could use an 'operator()(..)' overload in your 'Signal[String?]' struct to make it even more succinct by skipping 'connect()' altogether:
Ooo; yeah, baby.
Thanks for humoring me.
I could even like '2' if the first argument was a strongly-typed enum instead of a 'constexpr char *'. (Efficiency aside, the strings in '1' & '2' just don't feel very C++ & that bugs me. Granted, I don't load any parameters from text files.)
If I had to choose between '4' & '5', I suppose I would have a very minor preference for '5', only because it reads well as english in your example.
And, while you're breaking interfaces and I'm being OCD, would you consider changing 'connect()' to 'assign()'?
Code Select
5. button->signalPressed.assign(myCallbackFunc);
Or better yet, for '4', you could use an 'operator()(..)' overload in your 'Signal[String?]' struct to make it even more succinct by skipping 'connect()' altogether:
Code Select
4'. button->onPress(myCallbackFunc);
Ooo; yeah, baby.
Thanks for humoring me.