Skip to content

Commit e053209

Browse files
committed
CapabilityInquiryDemo: Fix build failures when using new C++ standards (20, 23) with old MSVC toolchains (2019 v142)
1 parent a8c85f5 commit e053209

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/Audio/CapabilityInquiryDemo.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,10 +2134,11 @@ class DiscoveryInfoPanel : public Component
21342134
DiscoveryInfoPanel (State<ci::MUID> m, State<Model::DeviceInfo> s)
21352135
: muidState (m), state (s)
21362136
{
2137+
const auto setStateCallback = [this] { setStateFromUI(); };
21372138
[&] (auto&&... item)
21382139
{
21392140
(addAndMakeVisible (item), ...);
2140-
((item.onCommit ([this] { setStateFromUI(); })), ...);
2141+
((item.onCommit (setStateCallback)), ...);
21412142
} (manufacturer, family, modelNumber, revision, maxSysExSize);
21422143

21432144
[&] (auto&&... item)
@@ -2719,11 +2720,13 @@ class PropertyInfoPanel : public Component
27192720
addAndMakeVisible (canSetField);
27202721
}
27212722

2723+
const auto updateStateCallback = [this] { updateStateFromUI(); };
2724+
27222725
[&] (auto&&... args)
27232726
{
27242727
(addAndMakeVisible (args), ...);
27252728
(args.setClickingTogglesState (isEditable), ...);
2726-
((args.onClick = [this] { updateStateFromUI(); }), ...);
2729+
((args.onClick = updateStateCallback), ...);
27272730
} (canGet,
27282731
canSubscribe,
27292732
canPaginate,
@@ -2744,7 +2747,7 @@ class PropertyInfoPanel : public Component
27442747
(args.setMultiLine (true), ...);
27452748
((args.onReturnKey = args.onEscapeKey
27462749
= args.onFocusLost
2747-
= [this] { updateStateFromUI(); }), ...);
2750+
= updateStateCallback), ...);
27482751
} (schema, mediaTypes, columns);
27492752

27502753
addAndMakeVisible (name);

0 commit comments

Comments
 (0)