Opened 5 years ago
Closed 4 years ago
#904 closed request (fixed)
cxx11 features - default behaviour
Reported by: | Peter | Owned by: | Peter |
---|---|---|---|
Priority: | major | Milestone: | yat 0.17 |
Component: | utility | Version: | trunk |
Keywords: | Cc: |
Description (last modified by )
The current default behaviour (no --enable-cxx11 nor --disable-cxx11) is that configure
checks for features and if and #define
s YAT_HAVE_RVALUE
if compiler supports rvalues. However, the section in yat/utility/config_public.h
is protected by guards
#if YAT_HAVE_CXX11__ #define YAT_HAVE_RVALUE 1 #endif
and the (private) macro, YAT_HAVE_CXX11__
is only #defined
, if user #defines
YAT_WITH_CXX11
. Internally, yat #defines
YAT_WITH_CXX11
(in config.h), so the libyat is in this case built with cxx11 features (meaning both speedups and such as well as API extensions are implemented in the lib). When external code is compiled against yat, cxx11 features are only available if the user #defines
YAT_WITH_CXX11
. I suggest we modify this requirement, so the default behaviour is that cxx11 features are available if they've been found during configure (but configure does not turn on switches such as -std=c++11).
In other words, in the code:
#ifndef YAT_WITH_CXX11 # ifndef YAT_WITHOUT_CXX11 # define YAT_HAVE_CXX11__ 0 # else # // default # define YAT_HAVE_CXX11__ 0 # endif #else # ifdef YAT_WITHOUT_CXX11 # error "cannot set both YAT_WITH_CXX11 and YAT_WITHOUT_CXX11" # endif # define YAT_HAVE_CXX11__ 1 #endif
change the default case and #define
YAT_HAVE_CXX11__
(and also change the if logic and get rid of the negations)
Change History (2)
comment:1 Changed 4 years ago by
Description: | modified (diff) |
---|---|
Milestone: | yat 0.x+ → yat 0.17 |
Owner: | changed from Jari Häkkinen to Peter |
Status: | new → accepted |
comment:2 Changed 4 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
In 3804: