From 46a445cdaa7a070824a11d395d421f5a60cde472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Aug 2023 11:42:24 +0200 Subject: [PATCH] Removed ugly define --- src/OpenMesh/Core/IO/SR_binary.hh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/OpenMesh/Core/IO/SR_binary.hh b/src/OpenMesh/Core/IO/SR_binary.hh index 887a24ed..a64ae089 100644 --- a/src/OpenMesh/Core/IO/SR_binary.hh +++ b/src/OpenMesh/Core/IO/SR_binary.hh @@ -80,11 +80,6 @@ namespace IO { //----------------------------------------------------------------------------- // struct binary, helper for storing/restoring -#define X \ - std::ostringstream msg; \ - msg << "Type not supported: " << typeid(value_type).name(); \ - throw std::logic_error(msg.str()) - /// \struct binary SR_binary.hh /// /// The struct defines how to store and restore the type T. @@ -119,7 +114,11 @@ template < typename T, typename = void > struct binary const value_type& /* _v */, bool /* _swap */ = false , bool /* store_size */ = true ) // for vectors - { X; return 0; } + { + std::ostringstream msg; + msg << "Type not supported: " << typeid(value_type).name(); + throw std::logic_error(msg.str()); + } /// Restore a value of T and return the number of bytes read static @@ -127,7 +126,11 @@ template < typename T, typename = void > struct binary value_type& /* _v */, bool /* _swap */ = false , bool /* store_size */ = true ) // for vectors - { X; return 0; } + { + std::ostringstream msg; + msg << "Type not supported: " << typeid(value_type).name(); + throw std::logic_error(msg.str()); + } }; #undef X