jarro2783 / cxxopts

Lightweight C++ command line option parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception when calling xxx.as<T>()...

FredM67 opened this issue · comments

I've a project under MSVC 2017. If CXXOPTS_NO_RTTI is not defined, any call to xxx.as<T>() produce an exception.

Exception occurs at line 1458 of cxxopts.hpp, deeper at line 291 of rtti.cpp.

Unhandled exception at 0x00007FFAB6D24FD9 in bla.exe: Microsoft C++ exception: std::__non_rtti_object at memory location 0x000000FEE92FE820.

I'll take a look.

It looks like you need to also define CXXOPTS_NO_EXCEPTIONS, CXXOPTS_NO_RTTI only turns off dynamic vs static casting. I'm not sure if there is any benefit having those separated, I might just combine them into one option.