From 4725e466f2d24ab035438895bd2c8e271c0d5527 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 29 Nov 2022 18:21:12 +0100 Subject: [PATCH] Base: fix build failure with MSVC, overloaded operator << must be in header file --- src/Base/Builder3D.cpp | 7 ------- src/Base/Builder3D.h | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Base/Builder3D.cpp b/src/Base/Builder3D.cpp index 8099268bee..3708b20741 100644 --- a/src/Base/Builder3D.cpp +++ b/src/Base/Builder3D.cpp @@ -124,13 +124,6 @@ const char* PolygonOffset::styleAsString() const // ----------------------------------------------------------------------------- -std::ostream& operator<<( std::ostream& os, Indentation m) -{ - for (int i = 0; i < m.count(); i++) - os << " "; - return os; -} - InventorOutput::InventorOutput(std::ostream& result, Indentation& indent) : result(result) , indent(indent) diff --git a/src/Base/Builder3D.h b/src/Base/Builder3D.h index 47f2b34c6f..bc7192fcab 100644 --- a/src/Base/Builder3D.h +++ b/src/Base/Builder3D.h @@ -159,6 +159,12 @@ public: int count() { return spaces; } + friend std::ostream& operator<<( std::ostream& os, Indentation m) + { + for (int i = 0; i < m.count(); i++) + os << " "; + return os; + } }; class BaseExport InventorOutput