Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce =std=c++14 for lambda capture initializers #12865

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

rurban
Copy link

@rurban rurban commented Apr 18, 2024

Fixes realsense-viewer.cpp:69:33: warning: lambda capture initializers only available with ‘-std=c++14’ or ‘-std=gnu++14’ [-Wc++14-extensions]
69 | [&viewer_model, weak_device_models = std::weak_ptr< device_models_list >( device_models ), filename](

This is needed on C++17 compilers.

realsense-viewer.cpp:69:33: warning: lambda capture initializers only available with ‘-std=c++14’ or ‘-std=gnu++14’ [-Wc++14-extensions]
   69 |                 [&viewer_model, weak_device_models = std::weak_ptr< device_models_list >( device_models ), filename](

MSVC TODO
@maloel
Copy link
Collaborator

maloel commented Apr 18, 2024

Hi @rurban
Thanks.

This is needed on C++17 compilers

You mean the compiler makes this into an error? Can you clarify? Which compiler? Can you add the message it gives?

The library itself turns on C++14, but not the surrounding tools & examples.
If the Viewer triggers this specific warning, we can turn C++14 on for the Viewer, but we kept the binaries at C++11 on purpose. It might be time to move on, but I want to first clarify what the compiler issue is.

@rurban
Copy link
Author

rurban commented May 15, 2024

All compilers which default to std=c++17, e..g. since gcc-11.
I was using gcc-13 and now gcc-14

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.

None yet

2 participants