enkisoftware / imgui_markdown

Markdown for Dear ImGui
zlib License
1.03k stars 69 forks source link

C++11 support #10

Closed juliettef closed 3 years ago

juliettef commented 3 years ago

imgui_markdown currently requires C++14 due to the use of aggregate initializers along with default member initializers. Adding C++11 constructors would break users' code in a way that would be difficult to workaround, and adding initializer list constructors is somewhat of a pain.

Question: do you need C++11 support and why?

NewYaroslav commented 3 years ago

Добрый день! Нужна поддержка. Был бы очень благодарен!

dougbinks commented 3 years ago

We've updated the code with backwards compatible C++11 support, along with modifying the example to show how to use this.

The ability to use aggregate initialization in C++14 with default member initializers makes imgui_markdown is easier to use in C++14. Sadly adding C++11 style constructors would break this, so this approach seems to be the best of both worlds.