diff --git a/src/Magnum/Array.h b/src/Magnum/Array.h index efec033cb..bbf0abe05 100644 --- a/src/Magnum/Array.h +++ b/src/Magnum/Array.h @@ -204,7 +204,7 @@ template class Array3D: public Array<3, T> { }; /** @debugoperator{Magnum::Array} */ -template Debug operator<<(Debug debug, const Array& value) { +template Debug& operator<<(Debug& debug, const Array& value) { debug << "Array("; debug.setFlag(Debug::SpaceAfterEachValue, false); for(UnsignedInt i = 0; i != dimensions; ++i) { @@ -217,17 +217,17 @@ template Debug operator<<(Debug debug, const Ar } /** @debugoperator{Magnum::Array1D} */ -template inline Debug operator<<(Debug debug, const Array1D& value) { +template inline Debug& operator<<(Debug& debug, const Array1D& value) { return debug << static_cast&>(value); } /** @debugoperator{Magnum::Array2D} */ -template inline Debug operator<<(Debug debug, const Array2D& value) { +template inline Debug& operator<<(Debug& debug, const Array2D& value) { return debug << static_cast&>(value); } /** @debugoperator{Magnum::Array3D} */ -template inline Debug operator<<(Debug debug, const Array3D& value) { +template inline Debug& operator<<(Debug& debug, const Array3D& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Attribute.cpp b/src/Magnum/Attribute.cpp index 88a2feea1..5341634c3 100644 --- a/src/Magnum/Attribute.cpp +++ b/src/Magnum/Attribute.cpp @@ -139,7 +139,7 @@ UnsignedInt Attribute>::size(GLint components, DataType d CORRADE_ASSERT_UNREACHABLE(); } -Debug operator<<(Debug debug, SizedAttribute<1, 1>::Components value) { +Debug& operator<<(Debug& debug, SizedAttribute<1, 1>::Components value) { switch(value) { case SizedAttribute<1, 1>::Components::One: return debug << "Attribute::Components::One"; @@ -148,7 +148,7 @@ Debug operator<<(Debug debug, SizedAttribute<1, 1>::Components value) { return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, SizedAttribute<1, 2>::Components value) { +Debug& operator<<(Debug& debug, SizedAttribute<1, 2>::Components value) { switch(value) { case SizedAttribute<1, 2>::Components::One: return debug << "Attribute::Components::One"; @@ -159,7 +159,7 @@ Debug operator<<(Debug debug, SizedAttribute<1, 2>::Components value) { return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, SizedAttribute<1, 3>::Components value) { +Debug& operator<<(Debug& debug, SizedAttribute<1, 3>::Components value) { switch(value) { case SizedAttribute<1, 3>::Components::One: return debug << "Attribute::Components::One"; @@ -172,7 +172,7 @@ Debug operator<<(Debug debug, SizedAttribute<1, 3>::Components value) { return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, SizedAttribute<1, 4>::Components value) { +Debug& operator<<(Debug& debug, SizedAttribute<1, 4>::Components value) { switch(value) { case SizedAttribute<1, 4>::Components::One: return debug << "Attribute::Components::One"; @@ -187,7 +187,7 @@ Debug operator<<(Debug debug, SizedAttribute<1, 4>::Components value) { return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, SizedMatrixAttribute<2>::Components value) { +Debug& operator<<(Debug& debug, SizedMatrixAttribute<2>::Components value) { switch(value) { case SizedMatrixAttribute<2>::Components::Two: return debug << "Attribute::Components::Two"; @@ -196,7 +196,7 @@ Debug operator<<(Debug debug, SizedMatrixAttribute<2>::Components value) { return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, SizedMatrixAttribute<3>::Components value) { +Debug& operator<<(Debug& debug, SizedMatrixAttribute<3>::Components value) { switch(value) { case SizedMatrixAttribute<3>::Components::Three: return debug << "Attribute::Components::Three"; @@ -205,7 +205,7 @@ Debug operator<<(Debug debug, SizedMatrixAttribute<3>::Components value) { return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, SizedMatrixAttribute<4>::Components value) { +Debug& operator<<(Debug& debug, SizedMatrixAttribute<4>::Components value) { switch(value) { case SizedMatrixAttribute<4>::Components::Four: return debug << "Attribute::Components::Four"; @@ -214,7 +214,7 @@ Debug operator<<(Debug debug, SizedMatrixAttribute<4>::Components value) { return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, Attribute>::Components value) { +Debug& operator<<(Debug& debug, Attribute>::Components value) { switch(value) { case Attribute>::Components::One: return debug << "Attribute::Components::One"; @@ -233,7 +233,7 @@ Debug operator<<(Debug debug, Attribute>::Components valu return debug << "Attribute::Components::(invalid)"; } -Debug operator<<(Debug debug, FloatAttribute::DataType value) { +Debug& operator<<(Debug& debug, FloatAttribute::DataType value) { switch(value) { #define _c(value) case FloatAttribute::DataType::value: return debug << "Attribute::DataType::" #value; _c(UnsignedByte) @@ -254,7 +254,7 @@ Debug operator<<(Debug debug, FloatAttribute::DataType value) { } #ifndef MAGNUM_TARGET_GLES2 -Debug operator<<(Debug debug, IntAttribute::DataType value) { +Debug& operator<<(Debug& debug, IntAttribute::DataType value) { switch(value) { #define _c(value) case IntAttribute::DataType::value: return debug << "Attribute::DataType::" #value; _c(UnsignedByte) @@ -271,7 +271,7 @@ Debug operator<<(Debug debug, IntAttribute::DataType value) { #endif #ifndef MAGNUM_TARGET_GLES -Debug operator<<(Debug debug, DoubleAttribute::DataType value) { +Debug& operator<<(Debug& debug, DoubleAttribute::DataType value) { switch(value) { #define _c(value) case DoubleAttribute::DataType::value: return debug << "Attribute::DataType::" #value; _c(Double) @@ -282,7 +282,7 @@ Debug operator<<(Debug debug, DoubleAttribute::DataType value) { } #endif -Debug operator<<(Debug debug, Attribute>::DataType value) { +Debug& operator<<(Debug& debug, Attribute>::DataType value) { switch(value) { #define _c(value) case Attribute>::DataType::value: return debug << "Attribute::DataType::" #value; _c(UnsignedByte) @@ -303,7 +303,7 @@ Debug operator<<(Debug debug, Attribute>::DataType value) return debug << "Attribute::DataType::(invalid)"; } -Debug operator<<(Debug debug, Attribute>::DataType value) { +Debug& operator<<(Debug& debug, Attribute>::DataType value) { switch(value) { #define _c(value) case Attribute>::DataType::value: return debug << "Attribute::DataType::" #value; _c(UnsignedByte) diff --git a/src/Magnum/Attribute.h b/src/Magnum/Attribute.h index 124926a79..950ba2d0d 100644 --- a/src/Magnum/Attribute.h +++ b/src/Magnum/Attribute.h @@ -297,10 +297,10 @@ template class Attribute { #ifdef DOXYGEN_GENERATING_OUTPUT /** @debugoperatorclassenum{Magnum::Attribute,Magnum::Attribute::Components} */ -template Debug operator<<(Debug debug, Attribute::Components); +template Debug& operator<<(Debug& debug, Attribute::Components); /** @debugoperatorclassenum{Magnum::Attribute,Magnum::Attribute::DataType} */ -template Debug operator<<(Debug debug, Attribute::DataType); +template Debug& operator<<(Debug& debug, Attribute::DataType); #endif namespace Implementation { @@ -328,10 +328,10 @@ template<> struct SizedAttribute<1, 4>: SizedVectorAttribute<1> { enum class Components: GLint { One = 1, Two = 2, Three = 3, Four = 4 }; constexpr static Components DefaultComponents = Components::Four; }; -Debug MAGNUM_EXPORT operator<<(Debug debug, SizedAttribute<1, 1>::Components value); -Debug MAGNUM_EXPORT operator<<(Debug debug, SizedAttribute<1, 2>::Components value); -Debug MAGNUM_EXPORT operator<<(Debug debug, SizedAttribute<1, 3>::Components value); -Debug MAGNUM_EXPORT operator<<(Debug debug, SizedAttribute<1, 4>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 1>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 2>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 3>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 4>::Components value); /* Matrix attribute sizes */ template struct SizedMatrixAttribute; @@ -347,9 +347,9 @@ template<> struct SizedMatrixAttribute<4> { enum class Components: GLint { Four = 4 }; constexpr static Components DefaultComponents = Components::Four; }; -Debug MAGNUM_EXPORT operator<<(Debug debug, SizedMatrixAttribute<2>::Components value); -Debug MAGNUM_EXPORT operator<<(Debug debug, SizedMatrixAttribute<3>::Components value); -Debug MAGNUM_EXPORT operator<<(Debug debug, SizedMatrixAttribute<4>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<2>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<3>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<4>::Components value); template<> struct SizedAttribute<2, 2>: SizedVectorAttribute<2>, SizedMatrixAttribute<2> {}; template<> struct SizedAttribute<3, 3>: SizedVectorAttribute<3>, SizedMatrixAttribute<3> {}; template<> struct SizedAttribute<4, 4>: SizedVectorAttribute<4>, SizedMatrixAttribute<4> {}; @@ -400,7 +400,7 @@ struct FloatAttribute { CORRADE_ENUMSET_OPERATORS(FloatAttribute::DataOptions) -Debug MAGNUM_EXPORT operator<<(Debug debug, FloatAttribute::DataType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, FloatAttribute::DataType value); #ifndef MAGNUM_TARGET_GLES2 /* Base for int attributes */ @@ -425,7 +425,7 @@ struct IntAttribute { CORRADE_ENUMSET_OPERATORS(IntAttribute::DataOptions) -Debug MAGNUM_EXPORT operator<<(Debug debug, IntAttribute::DataType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, IntAttribute::DataType value); /* Base for unsigned int attributes */ struct UnsignedIntAttribute { @@ -459,7 +459,7 @@ struct DoubleAttribute { static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); }; -Debug MAGNUM_EXPORT operator<<(Debug debug, DoubleAttribute::DataType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DoubleAttribute::DataType value); #endif /* Floating-point three-component vector has additional data type compared to @@ -495,7 +495,7 @@ template<> struct Attribute>: SizedAttribute<1, 3> { static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); }; -Debug MAGNUM_EXPORT operator<<(Debug debug, Attribute>::DataType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Attribute>::DataType value); /* Floating-point four-component vector is absolutely special case */ template<> struct Attribute> { @@ -546,8 +546,8 @@ template<> struct Attribute> { static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); }; -Debug MAGNUM_EXPORT operator<<(Debug debug, Attribute>::Components value); -Debug MAGNUM_EXPORT operator<<(Debug debug, Attribute>::DataType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Attribute>::Components value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Attribute>::DataType value); /* Common float, int, unsigned int and double scalar attributes */ template<> struct Attribute: FloatAttribute, SizedAttribute<1, 1> {}; diff --git a/src/Magnum/Audio/Buffer.cpp b/src/Magnum/Audio/Buffer.cpp index 433f44d59..270b3b61f 100644 --- a/src/Magnum/Audio/Buffer.cpp +++ b/src/Magnum/Audio/Buffer.cpp @@ -29,7 +29,7 @@ namespace Magnum { namespace Audio { -Debug operator<<(Debug debug, const Buffer::Format value) { +Debug& operator<<(Debug& debug, const Buffer::Format value) { switch(value) { #define _c(value) case Buffer::Format::value: return debug << "Audio::Buffer::Format::" #value; _c(Mono8) diff --git a/src/Magnum/Audio/Buffer.h b/src/Magnum/Audio/Buffer.h index 5839407f1..1d3b0e60d 100644 --- a/src/Magnum/Audio/Buffer.h +++ b/src/Magnum/Audio/Buffer.h @@ -105,7 +105,7 @@ class Buffer { }; /** @debugoperatorclassenum{Magnum::Audio::Buffer,Magnum::Audio::Buffer::Format} */ -Debug MAGNUM_AUDIO_EXPORT operator<<(Debug debug, Buffer::Format value); +MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, Buffer::Format value); inline Buffer::Buffer(Buffer&& other): _id(other._id) { other._id = 0; diff --git a/src/Magnum/Audio/Renderer.cpp b/src/Magnum/Audio/Renderer.cpp index 03b3a4b17..85214cf5d 100644 --- a/src/Magnum/Audio/Renderer.cpp +++ b/src/Magnum/Audio/Renderer.cpp @@ -29,7 +29,7 @@ namespace Magnum { namespace Audio { -Debug operator<<(Debug debug, const Renderer::Error value) { +Debug& operator<<(Debug& debug, const Renderer::Error value) { switch(value) { #define _c(value) case Renderer::Error::value: return debug << "Audio::Renderer::Error::" #value; _c(NoError) @@ -44,7 +44,7 @@ Debug operator<<(Debug debug, const Renderer::Error value) { return debug << "Audio::Renderer::Error::(invalid)"; } -Debug operator<<(Debug debug, const Renderer::DistanceModel value) { +Debug& operator<<(Debug& debug, const Renderer::DistanceModel value) { switch(value) { #define _c(value) case Renderer::DistanceModel::value: return debug << "Audio::Renderer::DistanceModel::" #value; _c(None) diff --git a/src/Magnum/Audio/Renderer.h b/src/Magnum/Audio/Renderer.h index 523338762..bf158c717 100644 --- a/src/Magnum/Audio/Renderer.h +++ b/src/Magnum/Audio/Renderer.h @@ -260,10 +260,10 @@ class Renderer { }; /** @debugoperatorclassenum{Magnum::Audio::Renderer,Magnum::Audio::Renderer::Error} */ -Debug MAGNUM_AUDIO_EXPORT operator<<(Debug debug, Renderer::Error value); +MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, Renderer::Error value); /** @debugoperatorclassenum{Magnum::Audio::Renderer,Magnum::Audio::Renderer::DistanceModel} */ -Debug MAGNUM_AUDIO_EXPORT operator<<(Debug debug, Renderer::DistanceModel value); +MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, Renderer::DistanceModel value); }} diff --git a/src/Magnum/Audio/Source.cpp b/src/Magnum/Audio/Source.cpp index 4daf5b3ca..cdc9463cb 100644 --- a/src/Magnum/Audio/Source.cpp +++ b/src/Magnum/Audio/Source.cpp @@ -96,7 +96,7 @@ void Source::rewind(const std::vector>& sources) alSourceRewindv(ids.size(), ids); } -Debug operator<<(Debug debug, const Source::State value) { +Debug& operator<<(Debug& debug, const Source::State value) { switch(value) { #define _c(value) case Source::State::value: return debug << "Audio::Source::State::" #value; _c(Initial) diff --git a/src/Magnum/Audio/Source.h b/src/Magnum/Audio/Source.h index 2eb0dcce9..103fdcf09 100644 --- a/src/Magnum/Audio/Source.h +++ b/src/Magnum/Audio/Source.h @@ -701,7 +701,7 @@ class MAGNUM_AUDIO_EXPORT Source { }; /** @debugoperatorclassenum{Magnum::Audio::Source,Magnum::Audio::Source::State} */ -Debug MAGNUM_AUDIO_EXPORT operator<<(Debug debug, Source::State value); +MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, Source::State value); inline Source::Source(Source&& other): _id(other._id) { other._id = 0; diff --git a/src/Magnum/Buffer.cpp b/src/Magnum/Buffer.cpp index 86c29197d..7b11a5534 100644 --- a/src/Magnum/Buffer.cpp +++ b/src/Magnum/Buffer.cpp @@ -622,7 +622,7 @@ bool Buffer::unmapImplementationDSAEXT() { #endif #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, Buffer::TargetHint value) { +Debug& operator<<(Debug& debug, Buffer::TargetHint value) { switch(value) { #define _c(value) case Buffer::TargetHint::value: return debug << "Buffer::TargetHint::" #value; _c(Array) @@ -661,7 +661,7 @@ Debug operator<<(Debug debug, Buffer::TargetHint value) { #if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_BUILD_DEPRECATED) #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, Buffer::Target value) { +Debug& operator<<(Debug& debug, Buffer::Target value) { switch(value) { #ifndef MAGNUM_TARGET_GLES2 #define _c(value) case Buffer::Target::value: return debug << "Buffer::Target::" #value; diff --git a/src/Magnum/Buffer.h b/src/Magnum/Buffer.h index 535a245db..f53ea141e 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/Buffer.h @@ -1431,11 +1431,11 @@ CORRADE_ENUMSET_OPERATORS(Buffer::MapFlags) #endif /** @debugoperatorclassenum{Magnum::Buffer,Magnum::Buffer::TargetHint} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Buffer::TargetHint value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Buffer::TargetHint value); #if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_BUILD_DEPRECATED) /** @debugoperatorclassenum{Magnum::Buffer,Magnum::Buffer::Target} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Buffer::Target value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Buffer::Target value); #endif inline Buffer::Buffer(NoCreateT) noexcept: _id{0}, _targetHint{TargetHint::Array}, _flags{ObjectFlag::DeleteOnDestruction} diff --git a/src/Magnum/Context.cpp b/src/Magnum/Context.cpp index 450836704..a82b8ae7c 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/Context.cpp @@ -700,7 +700,7 @@ void Context::resetState(const States states) { #ifndef MAGNUM_TARGET_WEBGL #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const Context::Flag value) { +Debug& operator<<(Debug& debug, const Context::Flag value) { switch(value) { #define _c(value) case Context::Flag::value: return debug << "Context::Flag::" #value; _c(Debug) diff --git a/src/Magnum/Context.h b/src/Magnum/Context.h index 1ac5214a6..239d34f9e 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/Context.h @@ -485,7 +485,7 @@ class MAGNUM_EXPORT Context { #ifndef MAGNUM_TARGET_WEBGL /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flag} */ -MAGNUM_EXPORT Debug operator<<(Debug debug, Context::Flag value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Context::Flag value); #endif /** @hideinitializer diff --git a/src/Magnum/DebugOutput.cpp b/src/Magnum/DebugOutput.cpp index 4d8b60860..966d8f6cc 100644 --- a/src/Magnum/DebugOutput.cpp +++ b/src/Magnum/DebugOutput.cpp @@ -225,7 +225,7 @@ void DebugOutput::callbackImplementationKhr(const Callback callback, const void* } #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const DebugOutput::Source value) { +Debug& operator<<(Debug& debug, const DebugOutput::Source value) { switch(value) { #define _c(value) case DebugOutput::Source::value: return debug << "DebugOutput::Source::" #value; _c(Api) @@ -240,7 +240,7 @@ Debug operator<<(Debug debug, const DebugOutput::Source value) { return debug << "DebugOutput::Source::(invalid)"; } -Debug operator<<(Debug debug, const DebugOutput::Type value) { +Debug& operator<<(Debug& debug, const DebugOutput::Type value) { switch(value) { #define _c(value) case DebugOutput::Type::value: return debug << "DebugOutput::Type::" #value; _c(Error) @@ -258,7 +258,7 @@ Debug operator<<(Debug debug, const DebugOutput::Type value) { return debug << "DebugOutput::Type::(invalid)"; } -Debug operator<<(Debug debug, const DebugOutput::Severity value) { +Debug& operator<<(Debug& debug, const DebugOutput::Severity value) { switch(value) { #define _c(value) case DebugOutput::Severity::value: return debug << "DebugOutput::Severity::" #value; _c(High) @@ -312,7 +312,7 @@ void DebugMessage::insertImplementationGremedy(Source, Type, UnsignedInt, DebugO #endif #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const DebugMessage::Source value) { +Debug& operator<<(Debug& debug, const DebugMessage::Source value) { switch(value) { #define _c(value) case DebugMessage::Source::value: return debug << "DebugMessage::Source::" #value; _c(ThirdParty) @@ -330,7 +330,7 @@ Debug operator<<(Debug debug, const DebugMessage::Source value) { return debug << "DebugMessage::Source::(invalid)"; } -Debug operator<<(Debug debug, const DebugMessage::Type value) { +Debug& operator<<(Debug& debug, const DebugMessage::Type value) { switch(value) { #define _c(value) case DebugMessage::Type::value: return debug << "DebugMessage::Type::" #value; _c(Error) @@ -424,7 +424,7 @@ void DebugGroup::popImplementationExt() { } #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const DebugGroup::Source value) { +Debug& operator<<(Debug& debug, const DebugGroup::Source value) { switch(value) { #define _c(value) case DebugGroup::Source::value: return debug << "DebugGroup::Source::" #value; _c(ThirdParty) diff --git a/src/Magnum/DebugOutput.h b/src/Magnum/DebugOutput.h index 344b412ba..ba06e79c0 100644 --- a/src/Magnum/DebugOutput.h +++ b/src/Magnum/DebugOutput.h @@ -418,13 +418,13 @@ class MAGNUM_EXPORT DebugOutput { }; /** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Source} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, DebugOutput::Source value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Source value); /** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Type} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, DebugOutput::Type value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Type value); /** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Severity} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, DebugOutput::Severity value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Severity value); /** @brief Debug message @@ -691,10 +691,10 @@ class MAGNUM_EXPORT DebugMessage { }; /** @debugoperatorclassenum{Magnum::DebugMessage,Magnum::DebugMessage::Source} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, DebugMessage::Source value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugMessage::Source value); /** @debugoperatorclassenum{Magnum::DebugMessage,Magnum::DebugMessage::Type} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, DebugMessage::Type value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugMessage::Type value); /** @brief Debug group @@ -904,7 +904,7 @@ class MAGNUM_EXPORT DebugGroup { }; /** @debugoperatorclassenum{Magnum::DebugGroup,Magnum::DebugGroup::Source} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, DebugGroup::Source value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugGroup::Source value); } #else diff --git a/src/Magnum/DefaultFramebuffer.cpp b/src/Magnum/DefaultFramebuffer.cpp index 58d2dfc42..0f4b8949e 100644 --- a/src/Magnum/DefaultFramebuffer.cpp +++ b/src/Magnum/DefaultFramebuffer.cpp @@ -115,7 +115,7 @@ void DefaultFramebuffer::initializeContextBasedFunctionality(Context& context) { } #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const DefaultFramebuffer::Status value) { +Debug& operator<<(Debug& debug, const DefaultFramebuffer::Status value) { switch(value) { #define _c(value) case DefaultFramebuffer::Status::value: return debug << "DefaultFramebuffer::Status::" #value; _c(Complete) diff --git a/src/Magnum/DefaultFramebuffer.h b/src/Magnum/DefaultFramebuffer.h index 104567fae..5467145f9 100644 --- a/src/Magnum/DefaultFramebuffer.h +++ b/src/Magnum/DefaultFramebuffer.h @@ -476,7 +476,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { extern DefaultFramebuffer MAGNUM_EXPORT defaultFramebuffer; /** @debugoperatorclassenum{Magnum::DefaultFramebuffer,Magnum::DefaultFramebuffer::Status} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, DefaultFramebuffer::Status value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, DefaultFramebuffer::Status value); } diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/Framebuffer.cpp index 44a5e6e26..d39e1f6a1 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/Framebuffer.cpp @@ -349,7 +349,7 @@ void Framebuffer::textureLayerImplementationDSAEXT(BufferAttachment attachment, #endif #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const Framebuffer::Status value) { +Debug& operator<<(Debug& debug, const Framebuffer::Status value) { switch(value) { #define _c(value) case Framebuffer::Status::value: return debug << "Framebuffer::Status::" #value; _c(Complete) diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/Framebuffer.h index 55862c01d..5c3706da7 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/Framebuffer.h @@ -785,7 +785,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje }; /** @debugoperatorclassenum{Magnum::Framebuffer,Magnum::Framebuffer::Status} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Framebuffer::Status value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Framebuffer::Status value); inline Framebuffer::Framebuffer(Framebuffer&& other) noexcept { _id = other._id; diff --git a/src/Magnum/Math/Angle.h b/src/Magnum/Math/Angle.h index 411f08a47..6bd1cd45b 100644 --- a/src/Magnum/Math/Angle.h +++ b/src/Magnum/Math/Angle.h @@ -237,7 +237,7 @@ template constexpr Deg::Deg(Unit value): Unit( template constexpr Rad::Rad(Unit value): Unit(T(value)*Math::Constants::pi()/T(180)) {} /** @debugoperator{Magnum::Math::Rad} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Unit& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Unit& value) { debug << "Rad("; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << T(value) << ")"; @@ -246,7 +246,7 @@ template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug deb } /** @debugoperator{Magnum::Math::Deg} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Unit& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Unit& value) { debug << "Deg("; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << T(value) << ")"; @@ -256,11 +256,11 @@ template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug deb /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Unit&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Unit&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Unit&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Unit&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); #endif #endif diff --git a/src/Magnum/Math/BoolVector.h b/src/Magnum/Math/BoolVector.h index e3f0e4b77..3acd12e20 100644 --- a/src/Magnum/Math/BoolVector.h +++ b/src/Magnum/Math/BoolVector.h @@ -223,7 +223,7 @@ template class BoolVector { }; /** @debugoperator{Magnum::Math::BoolVector} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const BoolVector& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const BoolVector& value) { debug << "BoolVector("; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); for(std::size_t i = 0; i != size; ++i) { diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index 949438720..e36c54422 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -534,12 +534,12 @@ MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(4, Color4) #endif /** @debugoperator{Magnum::Math::Color3} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Color3& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color3& value) { return debug << static_cast&>(value); } /** @debugoperator{Magnum::Math::Color4} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Color4& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Color4& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Math/Complex.h b/src/Magnum/Math/Complex.h index ce898204e..fac9476d1 100644 --- a/src/Magnum/Math/Complex.h +++ b/src/Magnum/Math/Complex.h @@ -476,7 +476,7 @@ template inline Complex operator/(T scalar, const Complex& comple } /** @debugoperator{Magnum::Math::Complex} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Complex& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Complex& value) { debug << "Complex("; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << value.real() << ", " << value.imaginary() << ")"; @@ -486,9 +486,9 @@ template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug deb /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Complex&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Complex&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); #endif #endif diff --git a/src/Magnum/Math/Dual.h b/src/Magnum/Math/Dual.h index 83f2df9fe..038f2e7df 100644 --- a/src/Magnum/Math/Dual.h +++ b/src/Magnum/Math/Dual.h @@ -209,7 +209,7 @@ template class Dual { #endif /** @debugoperator{Magnum::Math::Dual} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Dual& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Dual& value) { debug << "Dual("; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << value.real() << ", " << value.dual() << ")"; diff --git a/src/Magnum/Math/DualComplex.h b/src/Magnum/Math/DualComplex.h index 7e4084016..f3082c0c4 100644 --- a/src/Magnum/Math/DualComplex.h +++ b/src/Magnum/Math/DualComplex.h @@ -369,7 +369,7 @@ template class DualComplex: public Dual> { }; /** @debugoperator{Magnum::Math::DualQuaternion} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const DualComplex& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const DualComplex& value) { debug << "DualComplex({"; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << value.real().real() << ", " << value.real().imaginary() << "}, {" @@ -380,9 +380,9 @@ template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug deb /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const DualComplex&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const DualComplex&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); #endif #endif diff --git a/src/Magnum/Math/DualQuaternion.h b/src/Magnum/Math/DualQuaternion.h index 11c0e5953..9c7af521c 100644 --- a/src/Magnum/Math/DualQuaternion.h +++ b/src/Magnum/Math/DualQuaternion.h @@ -358,7 +358,7 @@ template class DualQuaternion: public Dual> { }; /** @debugoperator{Magnum::Math::DualQuaternion} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const DualQuaternion& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const DualQuaternion& value) { debug << "DualQuaternion({{"; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << value.real().vector().x() << ", " << value.real().vector().y() << ", " << value.real().vector().z() @@ -371,9 +371,9 @@ template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug deb /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const DualQuaternion&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const DualQuaternion&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); #endif #endif diff --git a/src/Magnum/Math/Matrix.h b/src/Magnum/Math/Matrix.h index 161ad0100..de7012484 100644 --- a/src/Magnum/Math/Matrix.h +++ b/src/Magnum/Math/Matrix.h @@ -266,7 +266,7 @@ template using Matrix4x4 = Matrix<4, T>; MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(Matrix) /** @debugoperator{Magnum::Math::Matrix} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Matrix& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Matrix& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Math/Matrix3.h b/src/Magnum/Math/Matrix3.h index 1defefd43..f4702db42 100644 --- a/src/Magnum/Math/Matrix3.h +++ b/src/Magnum/Math/Matrix3.h @@ -380,7 +380,7 @@ MAGNUM_MATRIXn_OPERATOR_IMPLEMENTATION(3, Matrix3) #endif /** @debugoperator{Magnum::Math::Matrix3} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Matrix3& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Matrix3& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Math/Matrix4.h b/src/Magnum/Math/Matrix4.h index b224beaa1..1a209460a 100644 --- a/src/Magnum/Math/Matrix4.h +++ b/src/Magnum/Math/Matrix4.h @@ -481,7 +481,7 @@ MAGNUM_MATRIXn_OPERATOR_IMPLEMENTATION(4, Matrix4) #endif /** @debugoperator{Magnum::Math::Matrix4} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Matrix4& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Matrix4& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Math/Quaternion.h b/src/Magnum/Math/Quaternion.h index d09eab8c6..ca633ab78 100644 --- a/src/Magnum/Math/Quaternion.h +++ b/src/Magnum/Math/Quaternion.h @@ -532,7 +532,7 @@ template inline Quaternion operator/(T scalar, const Quaternion& } /** @debugoperator{Magnum::Math::Quaternion} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Quaternion& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Quaternion& value) { debug << "Quaternion({"; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << value.vector().x() << ", " << value.vector().y() << ", " << value.vector().z() << "}, " << value.scalar() << ")"; @@ -542,9 +542,9 @@ template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug deb /* Explicit instantiation for commonly used types */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Quaternion&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Quaternion&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); #endif #endif diff --git a/src/Magnum/Math/Range.h b/src/Magnum/Math/Range.h index 771b4202b..baee7986a 100644 --- a/src/Magnum/Math/Range.h +++ b/src/Magnum/Math/Range.h @@ -529,7 +529,7 @@ template class Range3D: public Range<3, T> { }; /** @debugoperator{Magnum::Math::Range} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Range& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Range& value) { debug << "Range({"; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); debug << value.min()[0]; diff --git a/src/Magnum/Math/RectangularMatrix.h b/src/Magnum/Math/RectangularMatrix.h index c8e43983d..b7b333c97 100644 --- a/src/Magnum/Math/RectangularMatrix.h +++ b/src/Magnum/Math/RectangularMatrix.h @@ -526,7 +526,7 @@ template inline RectangularMatrix Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Magnum::Math::RectangularMatrix& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Magnum::Math::RectangularMatrix& value) { debug << "Matrix("; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); for(std::size_t row = 0; row != rows; ++row) { @@ -544,29 +544,29 @@ template Corrade::Utility::Debug op #ifndef DOXYGEN_GENERATING_OUTPUT /* Explicit instantiation for types used in OpenGL */ /* Square matrices */ -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 2, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 3, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 4, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Float>&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 2, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 3, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 4, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Double>&); #endif /* Rectangular matrices */ -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 3, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 2, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 4, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 2, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 4, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 3, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Float>&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 3, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 2, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 4, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 2, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 4, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 3, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Double>&); #endif #define MAGNUM_RECTANGULARMATRIX_SUBCLASS_IMPLEMENTATION(cols, rows, ...) \ diff --git a/src/Magnum/Math/Test/UnitTest.cpp b/src/Magnum/Math/Test/UnitTest.cpp index d677681e4..45618351b 100644 --- a/src/Magnum/Math/Test/UnitTest.cpp +++ b/src/Magnum/Math/Test/UnitTest.cpp @@ -63,7 +63,7 @@ typedef Unit Sec; typedef Unit Seci; typedef Constants Constants; -inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, Sec value) { +inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, Sec value) { return debug << Float(value); } diff --git a/src/Magnum/Math/Vector.h b/src/Magnum/Math/Vector.h index 29023512d..25fcc0836 100644 --- a/src/Magnum/Math/Vector.h +++ b/src/Magnum/Math/Vector.h @@ -1069,7 +1069,7 @@ operator/(const Vector& a, const Vector& b) } /** @debugoperator{Magnum::Math::Vector} */ -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Vector& value) { +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector& value) { debug << "Vector("; debug.setFlag(Corrade::Utility::Debug::SpaceAfterEachValue, false); for(std::size_t i = 0; i != size; ++i) { @@ -1083,19 +1083,19 @@ template Corrade::Utility::Debug operator<<(Corrade:: /* Explicit instantiation for types used in OpenGL */ #ifndef DOXYGEN_GENERATING_OUTPUT -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<2, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<3, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<4, Float>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<2, Int>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<3, Int>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<4, Int>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<2, UnsignedInt>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<3, UnsignedInt>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<4, UnsignedInt>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Float>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Int>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Int>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Int>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, UnsignedInt>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, UnsignedInt>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, UnsignedInt>&); #ifndef MAGNUM_TARGET_GLES -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<2, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<3, Double>&); -extern template Corrade::Utility::Debug MAGNUM_EXPORT operator<<(Corrade::Utility::Debug, const Vector<4, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Double>&); +extern template MAGNUM_EXPORT Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Double>&); #endif #endif diff --git a/src/Magnum/Math/Vector2.h b/src/Magnum/Math/Vector2.h index 8d4088e0e..5aca64b59 100644 --- a/src/Magnum/Math/Vector2.h +++ b/src/Magnum/Math/Vector2.h @@ -214,7 +214,7 @@ MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(2, Vector2) #endif /** @debugoperator{Magnum::Math::Vector2} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Vector2& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector2& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Math/Vector3.h b/src/Magnum/Math/Vector3.h index 26774fc2b..83b0fdc89 100644 --- a/src/Magnum/Math/Vector3.h +++ b/src/Magnum/Math/Vector3.h @@ -267,7 +267,7 @@ MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(3, Vector3) #endif /** @debugoperator{Magnum::Math::Vector3} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Vector3& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector3& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Math/Vector4.h b/src/Magnum/Math/Vector4.h index 6d465df68..ad1490b6a 100644 --- a/src/Magnum/Math/Vector4.h +++ b/src/Magnum/Math/Vector4.h @@ -221,7 +221,7 @@ MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(4, Vector4) #endif /** @debugoperator{Magnum::Math::Vector4} */ -template inline Corrade::Utility::Debug operator<<(Corrade::Utility::Debug debug, const Vector4& value) { +template inline Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const Vector4& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Math/instantiation.cpp b/src/Magnum/Math/instantiation.cpp index e0d70be44..0ad1bfa12 100644 --- a/src/Magnum/Math/instantiation.cpp +++ b/src/Magnum/Math/instantiation.cpp @@ -84,24 +84,24 @@ template struct ConfigurationValue>; namespace Magnum { namespace Math { #ifndef DOXYGEN_GENERATING_OUTPUT -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Complex&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Complex&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Complex&); #endif -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const DualComplex&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const DualComplex&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualComplex&); #endif -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const DualQuaternion&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const DualQuaternion&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const DualQuaternion&); #endif -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Quaternion&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Quaternion&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Quaternion&); #endif /* Check proper size of GL types */ @@ -144,50 +144,50 @@ static_assert(sizeof(RectangularMatrix<3, 4, Double>) == 96, "Improper size of 3 static_assert(sizeof(RectangularMatrix<4, 3, Double>) == 96, "Improper size of 4x3 Double matrix"); #endif -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 2, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 3, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 4, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Float>&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 2, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 3, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 4, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 2, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 3, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 4, Double>&); #endif -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 3, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 2, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 4, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 2, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 4, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 3, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Float>&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 3, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 2, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<2, 4, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 2, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<3, 4, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const RectangularMatrix<4, 3, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 3, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 2, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<2, 4, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 2, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<3, 4, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const RectangularMatrix<4, 3, Double>&); #endif -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Unit&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Unit&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Unit&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Unit&); -#endif - -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<2, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<3, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<4, Float>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<2, Int>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<3, Int>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<4, Int>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<2, UnsignedInt>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<3, UnsignedInt>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<4, UnsignedInt>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Unit&); +#endif + +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Float>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Int>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Int>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Int>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, UnsignedInt>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, UnsignedInt>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, UnsignedInt>&); #ifndef MAGNUM_TARGET_GLES -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<2, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<3, Double>&); -template Corrade::Utility::Debug operator<<(Corrade::Utility::Debug, const Vector<4, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<2, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<3, Double>&); +template Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug&, const Vector<4, Double>&); #endif #endif diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/Mesh.cpp index 57e85b97b..acf2917d6 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/Mesh.cpp @@ -635,7 +635,7 @@ void Mesh::drawElementsInstancedImplementationNV(const GLsizei count, const GLin #endif #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, MeshPrimitive value) { +Debug& operator<<(Debug& debug, MeshPrimitive value) { switch(value) { #define _c(value) case MeshPrimitive::value: return debug << "MeshPrimitive::" #value; _c(Points) @@ -660,7 +660,7 @@ Debug operator<<(Debug debug, MeshPrimitive value) { return debug << "MeshPrimitive::(invalid)"; } -Debug operator<<(Debug debug, Mesh::IndexType value) { +Debug& operator<<(Debug& debug, Mesh::IndexType value) { switch(value) { #define _c(value) case Mesh::IndexType::value: return debug << "Mesh::IndexType::" #value; _c(UnsignedByte) diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index 4d30ea2b1..b28d53861 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -1018,10 +1018,10 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { }; /** @debugoperatorenum{Magnum::MeshPrimitive} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, MeshPrimitive value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, MeshPrimitive value); /** @debugoperatorclassenum{Magnum::Mesh,Magnum::Mesh::IndexType} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Mesh::IndexType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Mesh::IndexType value); inline GLuint Mesh::release() { const GLuint id = _id; diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/PixelFormat.cpp index 20953520c..226b6295a 100644 --- a/src/Magnum/PixelFormat.cpp +++ b/src/Magnum/PixelFormat.cpp @@ -30,7 +30,7 @@ namespace Magnum { #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const PixelFormat value) { +Debug& operator<<(Debug& debug, const PixelFormat value) { switch(value) { #define _c(value) case PixelFormat::value: return debug << "PixelFormat::" #value; #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) @@ -82,7 +82,7 @@ Debug operator<<(Debug debug, const PixelFormat value) { return debug << "PixelFormat::(invalid)"; } -Debug operator<<(Debug debug, const PixelType value) { +Debug& operator<<(Debug& debug, const PixelType value) { switch(value) { #define _c(value) case PixelType::value: return debug << "PixelType::" #value; _c(UnsignedByte) @@ -137,7 +137,7 @@ Debug operator<<(Debug debug, const PixelType value) { return debug << "PixelType::(invalid)"; } -Debug operator<<(Debug debug, const CompressedPixelFormat value) { +Debug& operator<<(Debug& debug, const CompressedPixelFormat value) { switch(value) { #define _c(value) case CompressedPixelFormat::value: return debug << "CompressedPixelFormat::" #value; #ifndef MAGNUM_TARGET_GLES diff --git a/src/Magnum/PixelFormat.h b/src/Magnum/PixelFormat.h index a191478cb..df6a44cd5 100644 --- a/src/Magnum/PixelFormat.h +++ b/src/Magnum/PixelFormat.h @@ -1193,13 +1193,13 @@ enum class CompressedPixelFormat: GLenum { }; /** @debugoperatorenum{Magnum::PixelFormat} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, PixelFormat value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, PixelFormat value); /** @debugoperatorenum{Magnum::PixelType} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, PixelType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, PixelType value); /** @debugoperatorenum{Magnum::CompressedPixelFormat} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, CompressedPixelFormat value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, CompressedPixelFormat value); } diff --git a/src/Magnum/Renderer.cpp b/src/Magnum/Renderer.cpp index 8b146a959..87222fbf6 100644 --- a/src/Magnum/Renderer.cpp +++ b/src/Magnum/Renderer.cpp @@ -238,7 +238,7 @@ Renderer::GraphicsResetStatus Renderer::graphicsResetStatusImplementationRobustn #endif #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const Renderer::Error value) { +Debug& operator<<(Debug& debug, const Renderer::Error value) { switch(value) { #define _c(value) case Renderer::Error::value: return debug << "Renderer::Error::" #value; _c(NoError) @@ -258,7 +258,7 @@ Debug operator<<(Debug debug, const Renderer::Error value) { } #ifndef MAGNUM_TARGET_WEBGL -Debug operator<<(Debug debug, const Renderer::ResetNotificationStrategy value) { +Debug& operator<<(Debug& debug, const Renderer::ResetNotificationStrategy value) { switch(value) { #define _c(value) case Renderer::ResetNotificationStrategy::value: return debug << "Renderer::ResetNotificationStrategy::" #value; _c(NoResetNotification) @@ -269,7 +269,7 @@ Debug operator<<(Debug debug, const Renderer::ResetNotificationStrategy value) { return debug << "Renderer::ResetNotificationStrategy::(invalid)"; } -Debug operator<<(Debug debug, const Renderer::GraphicsResetStatus value) { +Debug& operator<<(Debug& debug, const Renderer::GraphicsResetStatus value) { switch(value) { #define _c(value) case Renderer::GraphicsResetStatus::value: return debug << "Renderer::GraphicsResetStatus::" #value; _c(NoError) diff --git a/src/Magnum/Renderer.h b/src/Magnum/Renderer.h index 412167f3d..e7bddd740 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/Renderer.h @@ -1436,14 +1436,14 @@ class MAGNUM_EXPORT Renderer { }; /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::Error} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::Error value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::Error value); #ifndef MAGNUM_TARGET_WEBGL /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::ResetNotificationStrategy} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::ResetNotificationStrategy value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::ResetNotificationStrategy value); /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::GraphicsResetStatus} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Renderer::GraphicsResetStatus value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::GraphicsResetStatus value); #endif } diff --git a/src/Magnum/Resource.cpp b/src/Magnum/Resource.cpp index fea4895e3..2fc5c9d11 100644 --- a/src/Magnum/Resource.cpp +++ b/src/Magnum/Resource.cpp @@ -28,7 +28,7 @@ namespace Magnum { #ifndef DOXYGEN_GENERATING_OUTPUT -Debug MAGNUM_EXPORT operator<<(Debug debug, ResourceState value) { +Debug& operator<<(Debug& debug, const ResourceState value) { switch(value) { #define _c(value) case ResourceState::value: return debug << "ResourceState::" #value; _c(NotLoaded) diff --git a/src/Magnum/Resource.h b/src/Magnum/Resource.h index 94c51a823..7738c8d2a 100644 --- a/src/Magnum/Resource.h +++ b/src/Magnum/Resource.h @@ -69,7 +69,7 @@ enum class ResourceState: UnsignedByte { }; /** @debugoperatorenum{Magnum::ResourceState} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, ResourceState value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, ResourceState value); /** @brief Key for accessing resource @@ -100,7 +100,7 @@ class ResourceKey: public Utility::MurmurHash2::Digest { }; /** @debugoperator{Magnum::ResourceKey} */ -inline Debug operator<<(Debug debug, const ResourceKey& value) { +inline Debug& operator<<(Debug& debug, const ResourceKey& value) { return debug << static_cast&>(value); } diff --git a/src/Magnum/Sampler.cpp b/src/Magnum/Sampler.cpp index 39e3f8838..d9ebb810d 100644 --- a/src/Magnum/Sampler.cpp +++ b/src/Magnum/Sampler.cpp @@ -61,7 +61,7 @@ Float Sampler::maxMaxAnisotropy() { } #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const Sampler::Filter value) { +Debug& operator<<(Debug& debug, const Sampler::Filter value) { switch(value) { #define _c(value) case Sampler::Filter::value: return debug << "Sampler::Filter::" #value; _c(Nearest) @@ -72,7 +72,7 @@ Debug operator<<(Debug debug, const Sampler::Filter value) { return debug << "Sampler::Filter::(invalid)"; } -Debug operator<<(Debug debug, const Sampler::Mipmap value) { +Debug& operator<<(Debug& debug, const Sampler::Mipmap value) { switch(value) { #define _c(value) case Sampler::Mipmap::value: return debug << "Sampler::Mipmap::" #value; _c(Base) @@ -84,7 +84,7 @@ Debug operator<<(Debug debug, const Sampler::Mipmap value) { return debug << "Sampler::Mipmap::(invalid)"; } -Debug operator<<(Debug debug, const Sampler::Wrapping value) { +Debug& operator<<(Debug& debug, const Sampler::Wrapping value) { switch(value) { #define _c(value) case Sampler::Wrapping::value: return debug << "Sampler::Wrapping::" #value; _c(Repeat) @@ -103,7 +103,7 @@ Debug operator<<(Debug debug, const Sampler::Wrapping value) { } #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) -Debug operator<<(Debug debug, const Sampler::CompareMode value) { +Debug& operator<<(Debug& debug, const Sampler::CompareMode value) { switch(value) { #define _c(value) case Sampler::CompareMode::value: return debug << "Sampler::CompareMode::" #value; _c(None) @@ -114,7 +114,7 @@ Debug operator<<(Debug debug, const Sampler::CompareMode value) { return debug << "Sampler::CompareFunction::(invalid)"; } -Debug operator<<(Debug debug, const Sampler::CompareFunction value) { +Debug& operator<<(Debug& debug, const Sampler::CompareFunction value) { switch(value) { #define _c(value) case Sampler::CompareFunction::value: return debug << "Sampler::CompareFunction::" #value; _c(Never) @@ -133,7 +133,7 @@ Debug operator<<(Debug debug, const Sampler::CompareFunction value) { #endif #ifndef MAGNUM_TARGET_GLES -Debug operator<<(Debug debug, const Sampler::DepthStencilMode value) { +Debug& operator<<(Debug& debug, const Sampler::DepthStencilMode value) { switch(value) { #define _c(value) case Sampler::DepthStencilMode::value: return debug << "Sampler::DepthStencilMode::" #value; _c(DepthComponent) diff --git a/src/Magnum/Sampler.h b/src/Magnum/Sampler.h index 9705582cb..3e71bc240 100644 --- a/src/Magnum/Sampler.h +++ b/src/Magnum/Sampler.h @@ -256,25 +256,25 @@ class MAGNUM_EXPORT Sampler { }; /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::Filter} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Sampler::Filter value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::Filter value); /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::Mipmap} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Sampler::Mipmap value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::Mipmap value); /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::Wrapping} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Sampler::Wrapping value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::Wrapping value); #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::CompareMode} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Sampler::CompareMode value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::CompareMode value); /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::CompareFunction} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Sampler::CompareFunction value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::CompareFunction value); #endif #ifndef MAGNUM_TARGET_GLES /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::DepthStencilMode} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Sampler::DepthStencilMode value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::DepthStencilMode value); #endif } diff --git a/src/Magnum/SceneGraph/Animable.cpp b/src/Magnum/SceneGraph/Animable.cpp index 628e51a88..7e537e387 100644 --- a/src/Magnum/SceneGraph/Animable.cpp +++ b/src/Magnum/SceneGraph/Animable.cpp @@ -29,7 +29,7 @@ namespace Magnum { namespace SceneGraph { -Debug operator<<(Debug debug, AnimationState value) { +Debug& operator<<(Debug& debug, AnimationState value) { switch(value) { #define _c(value) case AnimationState::value: return debug << "SceneGraph::AnimationState::" #value; _c(Stopped) diff --git a/src/Magnum/SceneGraph/Animable.h b/src/Magnum/SceneGraph/Animable.h index e39c462d3..4e1df2a3c 100644 --- a/src/Magnum/SceneGraph/Animable.h +++ b/src/Magnum/SceneGraph/Animable.h @@ -57,7 +57,7 @@ enum class AnimationState: UnsignedByte { }; /** @debugoperatorenum{Magnum::SceneGraph::AnimationState} */ -Debug MAGNUM_SCENEGRAPH_EXPORT operator<<(Debug debug, AnimationState value); +MAGNUM_SCENEGRAPH_EXPORT Debug& operator<<(Debug& debug, AnimationState value); /** @brief Animable diff --git a/src/Magnum/Shader.cpp b/src/Magnum/Shader.cpp index ccdbdc3c3..21850f51a 100644 --- a/src/Magnum/Shader.cpp +++ b/src/Magnum/Shader.cpp @@ -898,7 +898,7 @@ bool Shader::compile(std::initializer_list> shade } #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const Shader::Type value) { +Debug& operator<<(Debug& debug, const Shader::Type value) { switch(value) { #define _c(value) case Shader::Type::value: return debug << "Shader::Type::" #value; _c(Vertex) diff --git a/src/Magnum/Shader.h b/src/Magnum/Shader.h index 0bfdaafd7..146debd7f 100644 --- a/src/Magnum/Shader.h +++ b/src/Magnum/Shader.h @@ -630,7 +630,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject { }; /** @debugoperatorclassenum{Magnum::Shader,Magnum::Shader::Type} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Shader::Type value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Shader::Type value); inline Shader::Shader(Shader&& other) noexcept: _type(other._type), _id(other._id), _sources(std::move(other._sources)) { other._id = 0; diff --git a/src/Magnum/Shapes/Composition.h b/src/Magnum/Shapes/Composition.h index 881d17566..a54d5e1b8 100644 --- a/src/Magnum/Shapes/Composition.h +++ b/src/Magnum/Shapes/Composition.h @@ -195,7 +195,7 @@ typedef Composition<3> Composition3D; #ifdef DOXYGEN_GENERATING_OUTPUT /** @debugoperatorclassenum{Magnum::Shapes::Composition,Magnum::Shapes::Composition::Type} */ -template Debug operator<<(Debug debug, typename Composition::Type value); +template Debug& operator<<(Debug& debug, typename Composition::Type value); #endif /** @relates Composition diff --git a/src/Magnum/Shapes/shapeImplementation.cpp b/src/Magnum/Shapes/shapeImplementation.cpp index 07614c514..ef70c149b 100644 --- a/src/Magnum/Shapes/shapeImplementation.cpp +++ b/src/Magnum/Shapes/shapeImplementation.cpp @@ -29,7 +29,7 @@ namespace Magnum { namespace Shapes { namespace Implementation { -Debug operator<<(Debug debug, ShapeDimensionTraits<2>::Type value) { +Debug& operator<<(Debug& debug, ShapeDimensionTraits<2>::Type value) { switch(value) { #define _val(value) case ShapeDimensionTraits<2>::Type::value: return debug << "Shapes::Shape2D::Type::" #value; _val(Point) @@ -48,7 +48,7 @@ Debug operator<<(Debug debug, ShapeDimensionTraits<2>::Type value) { return debug << "Shapes::Shape2D::Type::(unknown)"; } -Debug operator<<(Debug debug, ShapeDimensionTraits<3>::Type value) { +Debug& operator<<(Debug& debug, ShapeDimensionTraits<3>::Type value) { switch(value) { #define _val(value) case ShapeDimensionTraits<3>::Type::value: return debug << "Shapes::Shape3D::Type::" #value; _val(Point) diff --git a/src/Magnum/Shapes/shapeImplementation.h b/src/Magnum/Shapes/shapeImplementation.h index 80213fed0..170172188 100644 --- a/src/Magnum/Shapes/shapeImplementation.h +++ b/src/Magnum/Shapes/shapeImplementation.h @@ -87,8 +87,8 @@ template<> struct ShapeDimensionTraits<3> { }; }; -Debug MAGNUM_SHAPES_EXPORT operator<<(Debug debug, ShapeDimensionTraits<2>::Type value); -Debug MAGNUM_SHAPES_EXPORT operator<<(Debug debug, ShapeDimensionTraits<3>::Type value); +MAGNUM_SHAPES_EXPORT Debug& operator<<(Debug& debug, ShapeDimensionTraits<2>::Type value); +MAGNUM_SHAPES_EXPORT Debug& operator<<(Debug& debug, ShapeDimensionTraits<3>::Type value); /* Enum value corresponding to given type */ diff --git a/src/Magnum/Trade/AbstractMaterialData.cpp b/src/Magnum/Trade/AbstractMaterialData.cpp index a00cd0933..e4f7475b8 100644 --- a/src/Magnum/Trade/AbstractMaterialData.cpp +++ b/src/Magnum/Trade/AbstractMaterialData.cpp @@ -33,7 +33,7 @@ AbstractMaterialData::AbstractMaterialData(MaterialType type): _type(type) {} AbstractMaterialData::~AbstractMaterialData() {} -Debug operator<<(Debug debug, const MaterialType value) { +Debug& operator<<(Debug& debug, const MaterialType value) { switch(value) { #define _c(value) case MaterialType::value: return debug << "Trade::MaterialType::" #value; _c(Phong) diff --git a/src/Magnum/Trade/AbstractMaterialData.h b/src/Magnum/Trade/AbstractMaterialData.h index 1b8d1a88c..474e40b7f 100644 --- a/src/Magnum/Trade/AbstractMaterialData.h +++ b/src/Magnum/Trade/AbstractMaterialData.h @@ -79,7 +79,7 @@ class MAGNUM_EXPORT AbstractMaterialData { }; /** @debugoperatorenum{Magnum::Trade::MaterialType} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, MaterialType value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, MaterialType value); }} diff --git a/src/Magnum/Trade/ObjectData2D.cpp b/src/Magnum/Trade/ObjectData2D.cpp index a360ecc54..28152878e 100644 --- a/src/Magnum/Trade/ObjectData2D.cpp +++ b/src/Magnum/Trade/ObjectData2D.cpp @@ -38,7 +38,7 @@ ObjectData2D::~ObjectData2D() = default; ObjectData2D& ObjectData2D::operator=(ObjectData2D&&) = default; #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, ObjectInstanceType2D value) { +Debug& operator<<(Debug& debug, ObjectInstanceType2D value) { switch(value) { #define _c(value) case ObjectInstanceType2D::value: return debug << "Trade::ObjectInstanceType2D::" #value; _c(Camera) diff --git a/src/Magnum/Trade/ObjectData2D.h b/src/Magnum/Trade/ObjectData2D.h index 58125f5b5..cd56be741 100644 --- a/src/Magnum/Trade/ObjectData2D.h +++ b/src/Magnum/Trade/ObjectData2D.h @@ -121,7 +121,7 @@ class MAGNUM_EXPORT ObjectData2D { }; /** @debugoperatorenum{Magnum::Trade::ObjectInstanceType2D} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, ObjectInstanceType2D value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, ObjectInstanceType2D value); }} diff --git a/src/Magnum/Trade/ObjectData3D.cpp b/src/Magnum/Trade/ObjectData3D.cpp index c098e7498..2f1737193 100644 --- a/src/Magnum/Trade/ObjectData3D.cpp +++ b/src/Magnum/Trade/ObjectData3D.cpp @@ -38,7 +38,7 @@ ObjectData3D::~ObjectData3D() = default; ObjectData3D& ObjectData3D::operator=(ObjectData3D&&) = default; #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, ObjectInstanceType3D value) { +Debug& operator<<(Debug& debug, ObjectInstanceType3D value) { switch(value) { #define _c(value) case ObjectInstanceType3D::value: return debug << "Trade::ObjectInstanceType3D::" #value; _c(Camera) diff --git a/src/Magnum/Trade/ObjectData3D.h b/src/Magnum/Trade/ObjectData3D.h index b8f1ca7f9..679611152 100644 --- a/src/Magnum/Trade/ObjectData3D.h +++ b/src/Magnum/Trade/ObjectData3D.h @@ -123,7 +123,7 @@ class MAGNUM_EXPORT ObjectData3D { }; /** @debugoperatorenum{Magnum::Trade::ObjectInstanceType3D} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, ObjectInstanceType3D value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, ObjectInstanceType3D value); }} diff --git a/src/Magnum/Trade/TextureData.cpp b/src/Magnum/Trade/TextureData.cpp index bcfdbd39e..4120e99ac 100644 --- a/src/Magnum/Trade/TextureData.cpp +++ b/src/Magnum/Trade/TextureData.cpp @@ -28,7 +28,7 @@ namespace Magnum { namespace Trade { #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, const TextureData::Type value) { +Debug& operator<<(Debug& debug, const TextureData::Type value) { switch(value) { #define _c(value) case TextureData::Type::value: return debug << "Trade::TextureData::Type::" #value; _c(Texture1D) diff --git a/src/Magnum/Trade/TextureData.h b/src/Magnum/Trade/TextureData.h index e703991dd..89dca1998 100644 --- a/src/Magnum/Trade/TextureData.h +++ b/src/Magnum/Trade/TextureData.h @@ -110,7 +110,7 @@ class TextureData { }; /** @debugoperatorclassenum{Magnum::Trade::TextureData,Magnum::Trade::TextureData::Type} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, TextureData::Type value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, TextureData::Type value); }} diff --git a/src/Magnum/Version.cpp b/src/Magnum/Version.cpp index 18b1dc0f3..ca4ff2696 100644 --- a/src/Magnum/Version.cpp +++ b/src/Magnum/Version.cpp @@ -30,7 +30,7 @@ namespace Magnum { #ifndef DOXYGEN_GENERATING_OUTPUT -Debug operator<<(Debug debug, Version value) { +Debug& operator<<(Debug& debug, Version value) { switch(value) { #define _c(value, string) case Version::value: return debug << string; _c(None, "None") diff --git a/src/Magnum/Version.h b/src/Magnum/Version.h index 37f951b62..37515ae12 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/Version.h @@ -110,7 +110,7 @@ inline std::pair version(Version version) { } /** @debugoperatorenum{Magnum::Version} */ -Debug MAGNUM_EXPORT operator<<(Debug debug, Version value); +MAGNUM_EXPORT Debug& operator<<(Debug& debug, Version value); }