google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library

Home Page:https://flatbuffers.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[C++ / iccarm (IAR) / flatbuffers 2.0.6] Allow to build without std::optional even if C++17 is enabled

avaliente-bc opened this issue · comments

Hello,
I'm trying to use flatbuffers with IAR compiler for ARM (iccarm 9.20.4).
stl_emulation.h tries to use std::optional if it finds a c++17 capable compiler, but according to the compiler documentation: The compiler also supports the added language features in ISO/IEC 14882:2017 (C++17), but not the added library features.
So __cplusplus >= 201703L is true, but the compiler does not provide <optional> module.
Would it be possible via a compile definition to disable std::optional usage, even if the compiler is C++17 capable?

Something like FLATBUFFERS_NO_STD_OPTIONAL define that completely disable the std::optional usage.

Ok i just noticed it's fixed with b8c77d4, I just have to wait a release