[Clam-devel] breaking change

Dirk Griffioen dirk.griffioen at barcelonamedia.org
Mon May 25 09:36:35 PDT 2009


Hi All,

I notice the Processing base class has a method called 'Do' - which in
effect makes the object do what it should do.

In my opinion this should be the (overloaded) call operator and not
something like 'do' or 'run'
- this models the c convention of calling functions when you want to do
something
- is more idiomatic c++
- looks nicer (but that is an opinion :)

It would make the Processing base a first class 'function object'

    http://en.wikipedia.org/wiki/Function_object

and as such more adapt towards either Boost or the upcoming new C++
standard.
- boost::bind looks for operator()
- boost::thread does too

(bind is in TR1, threading in C++0x)

I know changing Processing is not something to be done on a wim, but I
thought I mention it. 

And

    void operator()()
    {
        this->Do();
    }

could be a nice intermediate

Best, Dirk





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20090525/77f532da/attachment-0003.htm>


More information about the clam-devel mailing list