Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2003-08-18 08:44:22


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk