From 8d09eaadb6b64a784c291c78325dafb0ccc4eeae Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 10 Jan 2018 11:43:18 +0000 Subject: [PATCH] Removed some defunct code from the C++1 feature detection macros, and simplified code which no longer needs to test for feature availability --- .../Source/Project/jucer_ProjectType.h | 2 +- .../ProjectSaving/jucer_ProjectExport_Xcode.h | 2 +- .../AU/juce_AUv3_Wrapper.mm | 10 +- .../VST3/juce_VST3_Wrapper.cpp | 2 +- .../juce_AudioUnitPluginFormat.mm | 2 +- .../containers/juce_ElementComparator.h | 2 +- modules/juce_core/containers/juce_HashMap.h | 2 +- modules/juce_core/javascript/juce_JSON.h | 2 +- modules/juce_core/memory/juce_ByteOrder.h | 2 +- .../memory/juce_OptionalScopedPointer.h | 2 +- modules/juce_core/misc/juce_WindowsRegistry.h | 2 +- .../juce_core/native/juce_osx_ObjCHelpers.h | 6 - .../juce_core/system/juce_CompilerSupport.h | 107 ++++++------------ modules/juce_core/system/juce_PlatformDefs.h | 8 +- .../juce_core/system/juce_TargetPlatform.h | 9 -- modules/juce_core/text/juce_String.cpp | 2 +- modules/juce_core/xml/juce_XmlElement.h | 4 +- modules/juce_cryptography/hashing/juce_MD5.h | 2 +- .../juce_data_structures/values/juce_Value.h | 4 +- .../components/juce_Component.h | 2 +- .../drawables/juce_SVGParser.cpp | 2 +- .../windows/juce_NativeMessageBox.h | 2 +- modules/juce_osc/osc/juce_OSCMessage.cpp | 2 - modules/juce_osc/osc/juce_OSCMessage.h | 18 +-- modules/juce_osc/osc/juce_OSCSender.h | 26 ++--- 25 files changed, 76 insertions(+), 148 deletions(-) diff --git a/extras/Projucer/Source/Project/jucer_ProjectType.h b/extras/Projucer/Source/Project/jucer_ProjectType.h index 56247ed33f..0a2c566f22 100644 --- a/extras/Projucer/Source/Project/jucer_ProjectType.h +++ b/extras/Projucer/Source/Project/jucer_ProjectType.h @@ -94,7 +94,7 @@ public: private: //============================================================================== - Target& operator= (const Target&) JUCE_DELETED_FUNCTION; + Target& operator= (const Target&) = delete; }; virtual bool supportsTargetType (Target::Type /*targetType*/) const { return false; } diff --git a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h index 8b3df15fac..870b88f90c 100644 --- a/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h +++ b/extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Xcode.h @@ -1675,7 +1675,7 @@ public: //============================================================================== const XcodeProjectExporter& owner; - Target& operator= (const Target&) JUCE_DELETED_FUNCTION; + Target& operator= (const Target&) = delete; }; mutable StringArray xcodeFrameworks; diff --git a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm index f396ef0f13..cdb44060bf 100644 --- a/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm +++ b/modules/juce_audio_plugin_client/AU/juce_AUv3_Wrapper.mm @@ -68,10 +68,6 @@ #define JUCE_VIEWCONTROLLER_OBJC_NAME(x) JUCE_JOIN_MACRO (x, FactoryAUv3) -#if ! JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES - #error AUv3 wrapper requires variadic template support -#endif - #if JUCE_IOS #define JUCE_IOS_MAC_VIEW UIView #else @@ -122,9 +118,9 @@ struct AudioProcessorHolder : public ReferenceCountedObject private: ScopedPointer processor; - AudioProcessorHolder& operator= (AudioProcessor*) JUCE_DELETED_FUNCTION; - AudioProcessorHolder (AudioProcessorHolder&) JUCE_DELETED_FUNCTION; - AudioProcessorHolder& operator= (AudioProcessorHolder&) JUCE_DELETED_FUNCTION; + AudioProcessorHolder& operator= (AudioProcessor*) = delete; + AudioProcessorHolder (AudioProcessorHolder&) = delete; + AudioProcessorHolder& operator= (AudioProcessorHolder&) = delete; }; //============================================================================== diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 3407486966..abf7edf0ab 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -106,7 +106,7 @@ private: ScopedPointer audioProcessor; ScopedJuceInitialiser_GUI libraryInitialiser; - JuceAudioProcessor() JUCE_DELETED_FUNCTION; + JuceAudioProcessor() = delete; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceAudioProcessor) }; diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index c5bafeb621..99fd26fefc 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -39,7 +39,7 @@ #endif #ifndef JUCE_SUPPORTS_AUv3 - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES && __OBJC2__ \ + #if __OBJC2__ \ && ((defined (MAC_OS_X_VERSION_MIN_REQUIRED) && defined (MAC_OS_X_VERSION_10_11) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)) \ || (defined (__IPHONE_OS_VERSION_MIN_REQUIRED) && defined (__IPHONE_9_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0))) #define JUCE_SUPPORTS_AUv3 1 diff --git a/modules/juce_core/containers/juce_ElementComparator.h b/modules/juce_core/containers/juce_ElementComparator.h index 91fc5026f9..d4e645ff57 100644 --- a/modules/juce_core/containers/juce_ElementComparator.h +++ b/modules/juce_core/containers/juce_ElementComparator.h @@ -39,7 +39,7 @@ struct SortFunctionConverter private: ElementComparator& comparator; - SortFunctionConverter& operator= (const SortFunctionConverter&) JUCE_DELETED_FUNCTION; + SortFunctionConverter& operator= (const SortFunctionConverter&) = delete; }; #endif diff --git a/modules/juce_core/containers/juce_HashMap.h b/modules/juce_core/containers/juce_HashMap.h index ab04728d7d..beff2438ea 100644 --- a/modules/juce_core/containers/juce_HashMap.h +++ b/modules/juce_core/containers/juce_HashMap.h @@ -455,7 +455,7 @@ public: int index; // using the copy constructor is ok, but you cannot assign iterators - Iterator& operator= (const Iterator&) JUCE_DELETED_FUNCTION; + Iterator& operator= (const Iterator&) = delete; JUCE_LEAK_DETECTOR (Iterator) }; diff --git a/modules/juce_core/javascript/juce_JSON.h b/modules/juce_core/javascript/juce_JSON.h index c185442be6..ed787adfc4 100644 --- a/modules/juce_core/javascript/juce_JSON.h +++ b/modules/juce_core/javascript/juce_JSON.h @@ -126,7 +126,7 @@ public: private: //============================================================================== - JSON() JUCE_DELETED_FUNCTION; // This class can't be instantiated - just use its static methods. + JSON() = delete; // This class can't be instantiated - just use its static methods. }; } // namespace juce diff --git a/modules/juce_core/memory/juce_ByteOrder.h b/modules/juce_core/memory/juce_ByteOrder.h index f2e53d5cb4..ed7cdefe11 100644 --- a/modules/juce_core/memory/juce_ByteOrder.h +++ b/modules/juce_core/memory/juce_ByteOrder.h @@ -129,7 +129,7 @@ public: JUCE_CONSTEXPR static bool isBigEndian() noexcept; private: - ByteOrder() JUCE_DELETED_FUNCTION; + ByteOrder() = delete; JUCE_DECLARE_NON_COPYABLE (ByteOrder) }; diff --git a/modules/juce_core/memory/juce_OptionalScopedPointer.h b/modules/juce_core/memory/juce_OptionalScopedPointer.h index 703e8de5c3..2417b7aa4e 100644 --- a/modules/juce_core/memory/juce_OptionalScopedPointer.h +++ b/modules/juce_core/memory/juce_OptionalScopedPointer.h @@ -181,7 +181,7 @@ private: // a scoped pointer, which is almost certainly not what you intended to do! // If you hit a problem with this, you probably meant to say // myPointer.setOwned (myScopedPointer.release()) - void setOwned (const ScopedPointer&) JUCE_DELETED_FUNCTION; + void setOwned (const ScopedPointer&) = delete; }; } // namespace juce diff --git a/modules/juce_core/misc/juce_WindowsRegistry.h b/modules/juce_core/misc/juce_WindowsRegistry.h index 1c49ac32ae..683f6f6ca4 100644 --- a/modules/juce_core/misc/juce_WindowsRegistry.h +++ b/modules/juce_core/misc/juce_WindowsRegistry.h @@ -127,7 +127,7 @@ public: JUCE_DEPRECATED (static bool keyExistsWow64 (const String&)); private: - WindowsRegistry() JUCE_DELETED_FUNCTION; + WindowsRegistry() = delete; JUCE_DECLARE_NON_COPYABLE (WindowsRegistry) }; diff --git a/modules/juce_core/native/juce_osx_ObjCHelpers.h b/modules/juce_core/native/juce_osx_ObjCHelpers.h index 483ceddb91..b65a7a3c70 100644 --- a/modules/juce_core/native/juce_osx_ObjCHelpers.h +++ b/modules/juce_core/native/juce_osx_ObjCHelpers.h @@ -204,7 +204,6 @@ static NSRect makeNSRect (const RectangleType& r) noexcept } #endif #if JUCE_MAC || JUCE_IOS -#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES // This is necessary as on iOS builds, some arguments may be passed on registers // depending on the argument type. The re-cast objc_msgSendSuper to a function @@ -217,8 +216,6 @@ static inline ReturnValue ObjCMsgSendSuper (struct objc_super* s, SEL sel, Param return fn (s, sel, params...); } -#endif - // These hacks are a workaround for newer Xcode builds which by default prevent calls to these objc functions.. typedef id (*MsgSendSuperFn) (struct objc_super*, SEL, ...); static inline MsgSendSuperFn getMsgSendSuperFn() noexcept { return (MsgSendSuperFn) (void*) objc_msgSendSuper; } @@ -399,8 +396,6 @@ Class* getJuceClassFromNSObject (NSObject* obj) return obj != nullptr ? ObjCLifetimeManagedClass:: template getIvar (obj, "cppObject") : nullptr; } -#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES - template ReturnT (^CreateObjCBlock(Class* object, ReturnT (Class::*fn)(Params...))) (Params...) { @@ -429,6 +424,5 @@ private: BlockType block; }; -#endif } // namespace juce diff --git a/modules/juce_core/system/juce_CompilerSupport.h b/modules/juce_core/system/juce_CompilerSupport.h index 6644a913fa..90d3e116f1 100644 --- a/modules/juce_core/system/juce_CompilerSupport.h +++ b/modules/juce_core/system/juce_CompilerSupport.h @@ -22,29 +22,25 @@ #pragma once -/* This file has some checks to see whether the compiler supports various C++11/14 features, - When these aren't available, the code defines a few workarounds, so that we can still use - some of the newer language features like nullptr and noexcept, even on old compilers. +/* + This file provides flags for compiler features that aren't supported on all platforms. */ //============================================================================== // GCC -#if (__cplusplus >= 201103L || defined (__GXX_EXPERIMENTAL_CXX0X__)) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 +#if JUCE_GCC + + #if (__GNUC__ * 100 + __GNUC_MINOR__) < 407 + #error "JUCE requires GCC 4.7 or later" + #endif + + #if ! (__cplusplus >= 201103L || defined (__GXX_EXPERIMENTAL_CXX0X__)) + #error "JUCE requires that GCC has C++11 compatibility enabled" + #endif + #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1 #define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1 - #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1 - - #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && ! defined (JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL) - #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 - #endif - - #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407 && ! defined (JUCE_DELETED_FUNCTION) - #define JUCE_DELETED_FUNCTION = delete - #endif - - #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 - #define JUCE_STDLIB_HAS_STD_FUNCTION_SUPPORT 1 - #endif + #define JUCE_STDLIB_HAS_STD_FUNCTION_SUPPORT 1 #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 500 #define JUCE_HAS_CONSTEXPR 1 @@ -59,36 +55,20 @@ //============================================================================== // Clang -#if JUCE_CLANG && defined (__has_feature) +#if JUCE_CLANG - #if __has_feature (cxx_noexcept) - #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1 + #if __clang_major__ < 5 + #error "JUCE requires Clang 5.0 or later" #endif - #if __has_feature (cxx_deleted_functions) - #define JUCE_DELETED_FUNCTION = delete - #endif + #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1 + #define JUCE_HAS_CONSTEXPR 1 - #if (defined (_LIBCPP_VERSION) || ! (JUCE_MAC || JUCE_IOS)) + #if defined (_LIBCPP_VERSION) || ! (JUCE_MAC || JUCE_IOS) #define JUCE_STDLIB_HAS_STD_FUNCTION_SUPPORT 1 - #endif - - #if __has_feature (cxx_generalized_initializers) && (defined (_LIBCPP_VERSION) || ! (JUCE_MAC || JUCE_IOS)) #define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1 #endif - #if __has_feature (cxx_variadic_templates) - #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1 - #endif - - #if __has_feature (cxx_override_control) && (! defined (JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL)) - #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 - #endif - - #if __has_feature(cxx_constexpr) - #define JUCE_HAS_CONSTEXPR 1 - #endif - #ifndef JUCE_COMPILER_SUPPORTS_ARC #define JUCE_COMPILER_SUPPORTS_ARC 1 #endif @@ -103,22 +83,22 @@ //============================================================================== // MSVC -#ifdef _MSC_VER +#if JUCE_MSVC - #if _MSC_VER >= 1700 - #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 + #if _MSC_VER < 1800 // VS2013 + #error "JUCE requires Visual Studio 2013 or later" #endif - #if _MSC_VER >= 1800 - #define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1 - #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1 - #define JUCE_DELETED_FUNCTION = delete - #define JUCE_STDLIB_HAS_STD_FUNCTION_SUPPORT 1 - #endif + #define JUCE_COMPILER_SUPPORTS_INITIALIZER_LISTS 1 + #define JUCE_STDLIB_HAS_STD_FUNCTION_SUPPORT 1 - #if _MSC_VER >= 1900 + #if _MSC_VER >= 1900 // VS2015 #define JUCE_COMPILER_SUPPORTS_NOEXCEPT 1 #define JUCE_HAS_CONSTEXPR 1 + #else + #define _ALLOW_KEYWORD_MACROS 1 // prevent a warning + #undef noexcept + #define noexcept throw() #endif #ifndef JUCE_EXCEPTIONS_DISABLED @@ -129,17 +109,6 @@ #endif //============================================================================== -// Declare some fake versions of nullptr and noexcept, for older compilers: - -#ifndef JUCE_DELETED_FUNCTION - /** This macro can be placed after a method declaration to allow the use of - the C++11 feature "= delete" on all compilers. - On newer compilers that support it, it does the C++11 "= delete", but on - older ones it's just an empty definition. - */ - #define JUCE_DELETED_FUNCTION -#endif - #if JUCE_HAS_CONSTEXPR #define JUCE_CONSTEXPR constexpr #else @@ -147,20 +116,10 @@ #endif #if ! DOXYGEN - #if ! JUCE_COMPILER_SUPPORTS_NOEXCEPT - #ifdef noexcept - #undef noexcept - #endif - #define noexcept throw() - #if defined (_MSC_VER) && _MSC_VER > 1600 - #define _ALLOW_KEYWORD_MACROS 1 // (to stop VC2012 complaining) - #endif - #endif - - #if ! JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL - #undef override - #define override - #endif + // These are old flags that are now supported on all compatible build targets + #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 + #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1 + #define JUCE_DELETED_FUNCTION = delete #endif //============================================================================== diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 56cb7d625e..b4806f1f7a 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -191,8 +191,8 @@ namespace juce };@endcode */ #define JUCE_DECLARE_NON_COPYABLE(className) \ - className (const className&) JUCE_DELETED_FUNCTION;\ - className& operator= (const className&) JUCE_DELETED_FUNCTION; + className (const className&) = delete;\ + className& operator= (const className&) = delete; /** This is a shorthand way of writing both a JUCE_DECLARE_NON_COPYABLE and JUCE_LEAK_DETECTOR macro for a class. @@ -206,8 +206,8 @@ namespace juce */ #define JUCE_PREVENT_HEAP_ALLOCATION \ private: \ - static void* operator new (size_t) JUCE_DELETED_FUNCTION; \ - static void operator delete (void*) JUCE_DELETED_FUNCTION; + static void* operator new (size_t) = delete; \ + static void operator delete (void*) = delete; //============================================================================== #if JUCE_MSVC && ! defined (DOXYGEN) diff --git a/modules/juce_core/system/juce_TargetPlatform.h b/modules/juce_core/system/juce_TargetPlatform.h index 2f6c921e41..1d4fb0c71c 100644 --- a/modules/juce_core/system/juce_TargetPlatform.h +++ b/modules/juce_core/system/juce_TargetPlatform.h @@ -185,21 +185,12 @@ #ifdef __clang__ #define JUCE_CLANG 1 - #if ((! __has_feature (cxx_nullptr)) || (! __has_feature (cxx_rvalue_references)) || (! __has_feature (cxx_static_assert))) - #error "Clang 3.2 and earlier are no longer supported!" - #endif #elif defined (__GNUC__) #define JUCE_GCC 1 - #if (__cplusplus < 201103L && (! defined (__GXX_EXPERIMENTAL_CXX0X__))) || ((__GNUC__ * 100 + __GNUC_MINOR__) < 406) - #error "GCC 4.5 and earlier are no longer supported!" - #endif #elif defined (_MSC_VER) #define JUCE_MSVC 1 - #if _MSC_VER < 1600 - #error "Visual Studio 2008 and earlier are no longer supported!" - #endif #else #error unknown compiler #endif diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index e9a2e7a8eb..4b35381dd1 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -62,7 +62,7 @@ static const EmptyString emptyString = { 0x3fffffff, sizeof (String::CharPointer class StringHolder { public: - StringHolder() JUCE_DELETED_FUNCTION; + StringHolder() = delete; typedef String::CharPointerType CharPointerType; typedef String::CharPointerType::CharType CharType; diff --git a/modules/juce_core/xml/juce_XmlElement.h b/modules/juce_core/xml/juce_XmlElement.h index d2f66f6e20..eb02e4abd9 100644 --- a/modules/juce_core/xml/juce_XmlElement.h +++ b/modules/juce_core/xml/juce_XmlElement.h @@ -734,7 +734,7 @@ private: String value; private: - XmlAttributeNode& operator= (const XmlAttributeNode&) JUCE_DELETED_FUNCTION; + XmlAttributeNode& operator= (const XmlAttributeNode&) = delete; }; friend class XmlDocument; @@ -758,7 +758,7 @@ private: // Sigh.. L"" or _T("") string literals are problematic in general, and really inappropriate // for XML tags. Use a UTF-8 encoded literal instead, or if you're really determined to use // UTF-16, cast it to a String and use the other constructor. - XmlElement (const wchar_t*) JUCE_DELETED_FUNCTION; + XmlElement (const wchar_t*) = delete; JUCE_LEAK_DETECTOR (XmlElement) }; diff --git a/modules/juce_cryptography/hashing/juce_MD5.h b/modules/juce_cryptography/hashing/juce_MD5.h index ffd22f8f47..4d4fa16cb7 100644 --- a/modules/juce_cryptography/hashing/juce_MD5.h +++ b/modules/juce_cryptography/hashing/juce_MD5.h @@ -111,7 +111,7 @@ private: // This private constructor is declared here to prevent you accidentally passing a // String and having it unexpectedly call the constructor that takes a File. - explicit MD5 (const String&) JUCE_DELETED_FUNCTION; + explicit MD5 (const String&) = delete; JUCE_LEAK_DETECTOR (MD5) }; diff --git a/modules/juce_data_structures/values/juce_Value.h b/modules/juce_data_structures/values/juce_Value.h index b2cd644395..aa4ea5db49 100644 --- a/modules/juce_data_structures/values/juce_Value.h +++ b/modules/juce_data_structures/values/juce_Value.h @@ -227,11 +227,11 @@ private: // This is disallowed to avoid confusion about whether it should // do a by-value or by-reference copy. - Value& operator= (const Value&) JUCE_DELETED_FUNCTION; + Value& operator= (const Value&) = delete; // This declaration prevents accidental construction from an integer of 0, // which is possible in some compilers via an implicit cast to a pointer. - explicit Value (void*) JUCE_DELETED_FUNCTION; + explicit Value (void*) = delete; }; /** Writes a Value to an OutputStream as a UTF8 string. */ diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index a9554b5c04..1193cfec3b 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -2374,7 +2374,7 @@ private: // This is included here to cause an error if you use or overload it - it has been deprecated in // favour of contains (Point) - void contains (int, int) JUCE_DELETED_FUNCTION; + void contains (int, int) = delete; #endif protected: diff --git a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp index 72bfa8a5b8..5ca2686ef6 100644 --- a/modules/juce_gui_basics/drawables/juce_SVGParser.cpp +++ b/modules/juce_gui_basics/drawables/juce_SVGParser.cpp @@ -1686,7 +1686,7 @@ private: deltaAngle = fmod (deltaAngle, MathConstants::twoPi); } - SVGState& operator= (const SVGState&) JUCE_DELETED_FUNCTION; + SVGState& operator= (const SVGState&) = delete; }; diff --git a/modules/juce_gui_basics/windows/juce_NativeMessageBox.h b/modules/juce_gui_basics/windows/juce_NativeMessageBox.h index 52e6d51872..dffc70d9f8 100644 --- a/modules/juce_gui_basics/windows/juce_NativeMessageBox.h +++ b/modules/juce_gui_basics/windows/juce_NativeMessageBox.h @@ -213,7 +213,7 @@ public: #endif private: - NativeMessageBox() JUCE_DELETED_FUNCTION; + NativeMessageBox() = delete; JUCE_DECLARE_NON_COPYABLE (NativeMessageBox) }; diff --git a/modules/juce_osc/osc/juce_OSCMessage.cpp b/modules/juce_osc/osc/juce_OSCMessage.cpp index 994d954bd6..3a4481d9db 100644 --- a/modules/juce_osc/osc/juce_OSCMessage.cpp +++ b/modules/juce_osc/osc/juce_OSCMessage.cpp @@ -152,7 +152,6 @@ public: } - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES beginTest ("Initialisation with argument list (C++11 only)"); { int testInt = 42; @@ -197,7 +196,6 @@ public: expectEquals (msg[4].getInt32(), testInt); } } - #endif } }; diff --git a/modules/juce_osc/osc/juce_OSCMessage.h b/modules/juce_osc/osc/juce_OSCMessage.h index 117d3bcb95..cb9ff1440a 100644 --- a/modules/juce_osc/osc/juce_OSCMessage.h +++ b/modules/juce_osc/osc/juce_OSCMessage.h @@ -53,7 +53,6 @@ public: OSCMessage (const OSCAddressPattern& ap) noexcept; - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES /** Constructs an OSCMessage object with the given address pattern and list of arguments. @@ -68,7 +67,6 @@ public: */ template OSCMessage (const OSCAddressPattern& ap, Arg1&& arg1, Args&&... args); - #endif /** Sets the address pattern of the OSCMessage. @@ -143,7 +141,6 @@ public: private: //============================================================================== - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES template void addArguments (Arg1&& arg1, Args&&... args) { @@ -152,7 +149,6 @@ private: } void addArguments() {} - #endif //============================================================================== OSCAddressPattern addressPattern; @@ -161,13 +157,11 @@ private: //============================================================================== -#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES - template - OSCMessage::OSCMessage (const OSCAddressPattern& ap, Arg1&& arg1, Args&&... args) - : addressPattern (ap) - { - addArguments (std::forward (arg1), std::forward (args)...); - } -#endif +template +OSCMessage::OSCMessage (const OSCAddressPattern& ap, Arg1&& arg1, Args&&... args) + : addressPattern (ap) +{ + addArguments (std::forward (arg1), std::forward (args)...); +} } // namespace juce diff --git a/modules/juce_osc/osc/juce_OSCSender.h b/modules/juce_osc/osc/juce_OSCSender.h index 9943953190..ebeadd7d1b 100644 --- a/modules/juce_osc/osc/juce_OSCSender.h +++ b/modules/juce_osc/osc/juce_OSCSender.h @@ -113,7 +113,6 @@ public: bool sendToIPAddress (const String& targetIPAddress, int targetPortNumber, const OSCBundle& bundle); - #if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES /** Creates a new OSC message with the specified address pattern and list of arguments, and sends it to the target. @@ -136,7 +135,6 @@ public: template bool sendToIPAddress (const String& targetIPAddress, int targetPortNumber, const OSCAddressPattern& address, Args&&... args); - #endif private: //============================================================================== @@ -150,19 +148,17 @@ private: //============================================================================== -#if JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES - template - bool OSCSender::send (const OSCAddressPattern& address, Args&&... args) - { - return send (OSCMessage (address, std::forward (args)...)); - } +template +bool OSCSender::send (const OSCAddressPattern& address, Args&&... args) +{ + return send (OSCMessage (address, std::forward (args)...)); +} - template - bool OSCSender::sendToIPAddress (const String& targetIPAddress, int targetPortNumber, - const OSCAddressPattern& address, Args&&... args) - { - return sendToIPAddress (targetIPAddress, targetPortNumber, OSCMessage (address, std::forward (args)...)); - } -#endif // JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES +template +bool OSCSender::sendToIPAddress (const String& targetIPAddress, int targetPortNumber, + const OSCAddressPattern& address, Args&&... args) +{ + return sendToIPAddress (targetIPAddress, targetPortNumber, OSCMessage (address, std::forward (args)...)); +} } // namespace juce