Il 08/02/2017 20:40, Marc Mutz ha scritto:
> I, however, intended to use the same feature for <string_view> and 
> <experimental/string_view>, which don't seem to have SD-6 feature test 
> macros (or else define them in the header which you're not allowed to 
> include to check), but since we compile qmake only in C++11, not higher, 
> this was greeted with an #error.

Well, it smells that at least under GCC this would be the idiomatic way:

#if __cplusplus > 201103L && __has_include(<experimental/string_view>)
#include <experimental/string_view>
#endif

(And > 201402L, i.e. post C++14, for string_view). Then again, you may
argue that the presence of the header, even in the right C++ version,
will not tell you if there's a #error "unimplemented" in there; this
sounds like a silly game to play against the toolchain.

Of course, MSVC does not bump __cplusplus (still 199711L). So perhaps
those version checks need to become Qt macros?

My 2 c,
-- 
Giuseppe D'Angelo | [email protected] | Senior Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to