From 4355ad8fc1bd20b1a96f51b65e43ab147f793cdc Mon Sep 17 00:00:00 2001 From: Stephane Janel Date: Mon, 2 Oct 2023 09:37:00 +0200 Subject: [PATCH] Some MSVC compiler bug has been fixed, remove workaround --- src/tech/include/cct_exception.hpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/tech/include/cct_exception.hpp b/src/tech/include/cct_exception.hpp index 07be17a5..fd1236e4 100644 --- a/src/tech/include/cct_exception.hpp +++ b/src/tech/include/cct_exception.hpp @@ -12,7 +12,7 @@ namespace cct { -/// Implementation of a simple string (untruncated) storage with noexcept constructors and what() method. +/// Implementation of a simple string (un-truncated) storage with noexcept constructors and what() method. /// To be constructed from a 'const char []', it needs to be small enough to fill in the buffer. For custom, longer /// error messages, the constructor from the rvalue of a string should be used instead. class exception : public std::exception { @@ -31,18 +31,10 @@ class exception : public std::exception { explicit exception(string&& str) noexcept(std::is_nothrow_move_constructible_v) : _data(std::move(str)) {} -#ifdef CCT_MSVC - // MSVC bug: https://developercommunity.visualstudio.com/t/using-fmtlib-on-a-custom-exceptions-constructor-pa/1673659 - // do not use fmt for building an exception waiting for the bug to be fixed... - // Exception message will be incorrect. - template - explicit exception(std::string_view fmt, Args&&...) : _data(std::in_place_type, fmt) {} -#else template explicit exception(format_string fmt, Args&&... args) : _data(std::in_place_type) { cct::format_to(std::back_inserter(std::get<1>(_data)), fmt, std::forward(args)...); } -#endif const char* what() const noexcept override { switch (_data.index()) {