From 0e608f77fa8a1f6f1d34ad45422509094cbccb36 Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Fri, 20 Sep 2024 17:29:05 +0100 Subject: [PATCH] SimpleShapedText: Avoid MSVC compiler bug for C++20 builds There appears to be a bug in the MSVC compiler relating to cpaturing a instance of a struct defined inside a lambda --- .../juce_graphics/fonts/juce_SimpleShapedText.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp b/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp index a6ea8e1f23..e7278c9f17 100644 --- a/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp +++ b/modules/juce_graphics/fonts/juce_SimpleShapedText.cpp @@ -1022,6 +1022,12 @@ void SimpleShapedText::shape (const String& data, yes }; + struct ConsumedGlyphs + { + std::vector glyphs; + Range textRange; + }; + const auto append = [&] (const BidiParagraph& bidiParagraph, Range range, const ShapingParams& shapingParams) { jassert (! range.isEmpty()); @@ -1113,12 +1119,6 @@ void SimpleShapedText::shape (const String& data, jassert (bestMatch.has_value()); - struct ConsumedGlyphs - { - std::vector glyphs; - Range textRange; - }; - const auto consumeGlyphs = [&]() -> ConsumedGlyphs { auto glyphs = [&]