Definitions of interface classes

Alexandros Frantzis alexandros.frantzis at
Tue Mar 26 10:00:54 UTC 2013

Hi all,

in the code we use a couple of slightly different ways to define
interface classes.  Although the variations are mostly equivalent
functionally, it would be nice to decide on a standard way and add
it to the coding guide. The variation I see mostly (and use) is:

class Interface
    virtual ~Interface() {}

    virtual void method1() = 0;
    virtual void method2() = 0;

    Interface() = default;
    Interface(Interface const&) = delete;
    Interface& operator=(Interface const&) = delete;

There was also some discussion about using:

virtual ~Interface() = default;

because of the noexcept guarantee.



More information about the Mir-devel mailing list