Merge pull request #4366 from malytomas/master

fix compilation with clangcl on windows
pull/4371/head
Kim Kulling 2022-02-02 22:36:01 +01:00 committed by GitHub
commit ce880331df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 15 deletions

View File

@ -98,10 +98,6 @@ public:
DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) { DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {
// empty // empty
} }
#if defined(_MSC_VER) && defined(__clang__)
DeadlyImportError(DeadlyImportError& other) = delete;
#endif
}; };
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@ -114,10 +110,6 @@ public:
template<typename... T> template<typename... T>
explicit DeadlyExportError(T&&... args) : explicit DeadlyExportError(T&&... args) :
DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {} DeadlyErrorBase(Assimp::Formatter::format(), std::forward<T>(args)...) {}
#if defined(_MSC_VER) && defined(__clang__)
DeadlyExportError(DeadlyExportError& other) = delete;
#endif
}; };
#ifdef _MSC_VER #ifdef _MSC_VER

View File

@ -119,29 +119,41 @@ public:
* work for const references, so many function prototypes will * work for const references, so many function prototypes will
* include const basic_formatter<T>& s but might still want to * include const basic_formatter<T>& s but might still want to
* modify the formatted string without the need for a full copy.*/ * modify the formatted string without the need for a full copy.*/
template <typename TToken> template <typename TToken, typename std::enable_if<!std::is_base_of<std::exception, TToken>::value>::type * = nullptr>
const basic_formatter &operator<<(const TToken &s) const { const basic_formatter &operator<<(const TToken &s) const {
underlying << s; underlying << s;
return *this; return *this;
} }
template <typename TToken> template <typename TToken, typename std::enable_if<std::is_base_of<std::exception, TToken>::value>::type * = nullptr>
const basic_formatter &operator<<(const TToken &s) const {
underlying << s.what();
return *this;
}
template <typename TToken, typename std::enable_if<!std::is_base_of<std::exception, TToken>::value>::type * = nullptr>
basic_formatter &operator<<(const TToken &s) { basic_formatter &operator<<(const TToken &s) {
underlying << s; underlying << s;
return *this; return *this;
} }
template <typename TToken, typename std::enable_if<std::is_base_of<std::exception, TToken>::value>::type * = nullptr>
basic_formatter &operator<<(const TToken &s) {
underlying << s.what();
return *this;
}
// comma operator overloaded as well, choose your preferred way. // comma operator overloaded as well, choose your preferred way.
template <typename TToken> template <typename TToken>
const basic_formatter& operator, (const TToken& s) const { const basic_formatter& operator, (const TToken& s) const {
underlying << s; *this << s;
return *this; return *this;
} }
template <typename TToken> template <typename TToken>
basic_formatter& operator, (const TToken& s) { basic_formatter& operator, (const TToken& s) {
underlying << s; *this << s;
return *this; return *this;
} }
@ -149,7 +161,7 @@ public:
// See https://sourceforge.net/projects/assimp/forums/forum/817654/topic/4372824 // See https://sourceforge.net/projects/assimp/forums/forum/817654/topic/4372824
template <typename TToken> template <typename TToken>
basic_formatter& operator, (TToken& s) { basic_formatter& operator, (TToken& s) {
underlying << s; *this << s;
return *this; return *this;
} }