Skip to content

Update lambas for C++20#1338

Merged
RytoEX merged 2 commits into
obsproject:masterfrom
RytoEX:update-to-cpp-20
May 1, 2026
Merged

Update lambas for C++20#1338
RytoEX merged 2 commits into
obsproject:masterfrom
RytoEX:update-to-cpp-20

Conversation

@RytoEX
Copy link
Copy Markdown
Member

@RytoEX RytoEX commented Apr 10, 2026

Description

Replace implicit lambda captures to be explicit for C++20 compliance while retaining C++17 compatibility.

Motivation and Context

Want obs-studio and its submodules to build with C++20 some day.

However, websocketpp, used by obs-websocket, is not C++20 compatible, so we will need to choose one of the following options:

  1. Patch websocketpp.
  2. Build obs-websocket as C++17 while the rest of the project builds as C++20.
  3. Replace websocketpp.

That said, I wanted to at least push the required obs-websocket changes here for visibility/review.

How Has This Been Tested?

Tested OS(s): Windows 11

Types of changes

  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Other Enhancement (anything not applicable to what is listed)

Checklist:

  • I have read the Contributing Guidelines.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • My code is not on master or a release/* branch.
  • The code has been tested.
  • I have included updates to all appropriate documentation.

@RytoEX RytoEX self-assigned this Apr 10, 2026
Copy link
Copy Markdown
Member

@PatTheMav PatTheMav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving mainly because it makes explicit what happened implicitly before, memory (un)safety is unchanged.

@RytoEX RytoEX merged commit 032c993 into obsproject:master May 1, 2026
1 check passed
@RytoEX RytoEX deleted the update-to-cpp-20 branch May 1, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants