Fix: Promote project's standards to C++17#284
Open
tcoyvwac wants to merge 1 commit intopatriciogonzalezvivo:mainfrom
Open
Fix: Promote project's standards to C++17#284tcoyvwac wants to merge 1 commit intopatriciogonzalezvivo:mainfrom
C++17#284tcoyvwac wants to merge 1 commit intopatriciogonzalezvivo:mainfrom
Conversation
8000ac7 to
0ed8829
Compare
0ed8829 to
025de67
Compare
025de67 to
3acf7d6
Compare
Contributor
Author
|
Due to a discovery in building PR:#319; because of an interesting characteristic highlighted during the Explanation: This feature is called "Designated Initializer Lists" So condensely explained, instead of being able to write the terse shortform: 🥲 union render_pass_args_t { // <-- [2]: Note: can use the union datatype for a bonus combo!
const vera::Fbo* const fbo;
const BuffersList* const fbolist; // using BuffersList = std::vector<vera::Fbo*>;
};
struct vtable_render_pass_t{
using func_sig_t = auto (*)(const std::string&, Uniforms&, const render_pass_args_t&, render_ui_t&)-> void;
const std::string prompt_id;
const render_pass_args_t process_info;
const func_sig_t process_render_pass;
};
const auto render_pass_table = { vtable_render_pass_t
{"u_buffer", {}, do_pass_singlebuffer}
, {"u_scene", {&m_sceneRender.renderFbo}, do_pass_scene}
, {"u_sceneBuffer", {.fbolist = &m_sceneRender.buffersFbo}, do_pass_scenebuffer} // <-- [1] for "Build (windows-latest)", this is "technically" a c++20 feature.
, {"u_sceneDepth", {&m_sceneRender.renderFbo}, do_pass_scenedepth}
};...we must be "strict" and write the very bluntish and verbose longform! (For struct render_pass_args_t { // <-- [2]: Warning: strict-mode C++11, and so we have to use struct datatype declaration!
const vera::Fbo* const fbo;
const BuffersList* const fbolist; // using BuffersList = std::vector<vera::Fbo*>;
};
struct vtable_render_pass_t{
using func_sig_t = auto (*)(const std::string&, Uniforms&, const render_pass_args_t&, render_ui_t&)-> void;
const std::string prompt_id;
const render_pass_args_t process_info;
const func_sig_t process_render_pass;
};
const auto render_pass_table = { vtable_render_pass_t
{"u_buffer", {nullptr, nullptr}, do_pass_singlebuffer}
, {"u_scene", {&m_sceneRender.renderFbo, nullptr}, do_pass_scene}
, {"u_sceneBuffer", {nullptr, &m_sceneRender.buffersFbo}, do_pass_scenebuffer} // <-- [1]: Boo. :( All fields must be declared for everything, to make "Build (windows-latest)" happy!
, {"u_sceneDepth", {&m_sceneRender.renderFbo, nullptr}, do_pass_scenedepth}
};If programming (OO) is all about "message passing"[1], it's disappointing and unfortunate that this nice feature is hidden behind C++20 on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
C++11, especially to do withconstexpr, lambdas, and standard algorithms.