Angus Leeming <[EMAIL PROTECTED]> writes:

| What's the official take on putting functors in namespace anon and then 
| passing them to an STL routine?
>
| Here, I get warnings like:
| cxx: Warning: /usr/include/cxx/algorithm.cc, line 110: #1115-D external 
| routine
|           uses unnamed type or namespace.
| InputIterator find_if (InputIterator first, InputIterator last, Predicate 
| pred)
| --------------^
>
| I'm quite happy to turn this warning off. Just curious about Best Practice. 
| Whatever that is.

I belive it should be ok.

What's not ok is using local classes for this:

class Foo {
      class Functor {};

      void do_stuff() {
           find_if(..., Functor());
      }
};

-- 
        Lgb

Reply via email to