Add defaulted copy and move operations to format_error and system_error (#1347)

* Avoid weak vtables by providing a private virtual member function

* Add warning Wweak-vtables to clang when FMT_PEDANTIC is on

* Add defaulted copy and move operations to format_error and system_error

Compiler generated copy operations are deprecated and move operations
are not generated altogether.

* Add warning Wdeprecated to clang when FMT_PEDANTIC is on
This commit is contained in:
Deniz Evrenci
2019-10-11 10:44:20 -07:00
committed by Victor Zverovich
parent b732f28c00
commit 96f91428c6
4 changed files with 19 additions and 1 deletions
+5
View File
@@ -14,8 +14,13 @@
class assertion_failure : public std::logic_error {
public:
explicit assertion_failure(const char* message) : std::logic_error(message) {}
private:
virtual void avoid_weak_vtable();
};
void assertion_failure::avoid_weak_vtable() {}
#define FMT_ASSERT(condition, message) \
if (!(condition)) throw assertion_failure(message);