I have something like this:
boost::function<void(void)> redStyle = boost::bind(colorStyle, "red");
boost::function<void(void)> blueBlinkingStyle = boost::bind(animatedStyle, "blue", BLINKING);
Is this the correct way to define a nullStyler:
void nothing(){}
boost::function<void(void)> noStyle = boost::bind(nothing);
I was thinking that I could do it this way instead but empty functions throw:
boost::function<void(void)> noStyle;
The code using the styler function could check for empty instead of using the "Null Object Pattern". Which is better? Having a weird nothing function in my Detail namespace or checking for empty?