lundi 24 octobre 2016

What does the C++ standard say about overriding a throw() function with noexcept?

The following seems to compile on a couple of compilers that I've tried:

class A
{
public:
    virtual void foo() throw() = 0;
};

class B : public A
{
public:
    virtual void foo() noexcept override { }
};

It seems that one can override a throw() function with the newer noexcept specification. Why is that? Is this undefined behavior or is this allowed?

Aucun commentaire:

Enregistrer un commentaire