In discussions about being able to specify a function to check the validity of path element names, a simple function pointer has been used:

typedef bool (*name_check)( const std::string & name );

Alternately, boost::function could be used. The boost::function docs mention several advantages over function pointers; the advantage that might particularly apply is that:

"Boost.Function allows arbitrary compatible function objects to be targets (instead of requiring an exact function signature)."

That can be a really powerful advantage in some applications, but usage of name checking in boost::filesystem seems likely to be limited to very simple cases where plain function pointers will do just fine. I'd also like to avoid the dependency on an additional library, since Boost regression test reporting breaks if boost::filesystem::path breaks.

So unless someone comes forward with a killer argument, a simple function pointer will be used.

Comments?

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to