int main() { // const-operator() // 1. rvalue reference: wrapper(Functor()); // 2. lvalue reference: Functor f; wrapper(f); // 3. const lvalue reference: const Functor cf; wrapper(cf); // 4. const rvalue reference: wrapper(make_functor()); // non-const operator() // 1. rvalue reference: wrapper(NonConstFunctor()); // 2. lvalue reference: NonConstFunctor ncf; wrapper(ncf); // 3. const lvalue reference: const NonConstFunctor cncf; wrapper(cncf); // 4. const rvalue reference: wrapper(make_non_const_functor()); }
boost::optional< cv_mat::filter > filters::make( const std::string& what ) { boost::function< cv_mat::filters::value_type( cv_mat::filters::value_type ) > functor = make_functor( what ); if( functor ) { return cv_mat::filter( functor ); } return boost::none; }