remove empty d'tor from osrm::exception

This commit is contained in:
Dennis Luxen 2015-01-05 15:53:28 +01:00
parent 25326b571b
commit 703a88a639

View File

@ -33,16 +33,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace osrm
{
class exception : public std::exception
class exception final : public std::exception
{
public:
explicit exception(const char *message) : message(message) {}
explicit exception(const std::string &message) : message(message) {}
virtual ~exception() noexcept {}
private:
// This function exists to 'anchor' the class, and stop the compiler from
// copying vtable and RTTI info into every object file that includes
// this header. (Caught by -Wweak-vtables under Clang.)
virtual void anchor() const;
virtual const char *what() const noexcept { return message.c_str(); }
const char *what() const noexcept { return message.c_str(); }
const std::string message;
};
}