diff options
author | Jean-Michaël Celerier <jeanmichael.celerier@gmail.com> | 2017-04-28 18:24:55 +0300 |
---|---|---|
committer | Jean-Michaël Celerier <jeanmichael.celerier@gmail.com> | 2017-04-28 18:24:55 +0300 |
commit | 53138c20fb19991ae62764cff73a802b746ab824 (patch) | |
tree | b355fc9d276d1f2778534e4de46faac64d988461 /include/spdlog/formatter.h | |
parent | 9e6d81de089a282ef779ab6429be6aeb7f27e2c1 (diff) |
Add an optional final qualifier to types
When building with GCC's -Wfinal-types, a lot of types of spdlog
are marked as being more optimizable if they were marked final.
This patch adds a possibility for the user of the library to `#define SPDLOG_FINAL final`
and enjoy potentially better performance : GCC is then able to replace virtual calls by true
function calls if it can ensure that there are no derived types).
By default SPDLOG_FINAL is defined to nothing to not break existing code that
may be inheriting of some of these types for some reason.
Diffstat (limited to 'include/spdlog/formatter.h')
-rw-r--r-- | include/spdlog/formatter.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/spdlog/formatter.h b/include/spdlog/formatter.h index 0ffcec03..639cc7d2 100644 --- a/include/spdlog/formatter.h +++ b/include/spdlog/formatter.h @@ -25,7 +25,7 @@ public: virtual void format(details::log_msg& msg) = 0; }; -class pattern_formatter : public formatter +class pattern_formatter SPDLOG_FINAL : public formatter { public: |