fix compilation with clangcl on windows

This commit is contained in:
Tomas Maly 2022-01-30 22:04:41 +01:00
parent a214b0833f
commit 3976f9a092
2 changed files with 19 additions and 15 deletions

View File

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

View File

@ -119,29 +119,41 @@ public:
* work for const references, so many function prototypes will
* include const basic_formatter<T>& s but might still want to
* modify the formatted string without the need for a full copy.*/
template <typename TToken>
const basic_formatter& operator << (const TToken& s) const {
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;
return *this;
}
template <typename TToken>
basic_formatter& operator << (const TToken& s) {
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) {
underlying << s;
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.
template <typename TToken>
const basic_formatter& operator, (const TToken& s) const {
underlying << s;
*this << s;
return *this;
}
template <typename TToken>
basic_formatter& operator, (const TToken& s) {
underlying << s;
*this << s;
return *this;
}
@ -149,7 +161,7 @@ public:
// See https://sourceforge.net/projects/assimp/forums/forum/817654/topic/4372824
template <typename TToken>
basic_formatter& operator, (TToken& s) {
underlying << s;
*this << s;
return *this;
}