Opened 20 months ago

Closed 6 weeks 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 Peter)

The current default behaviour (no --enable-cxx11 nor --disable-cxx11) is that configure checks for features and if and #defines 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 6 weeks ago by Peter

Description: modified (diff)
Milestone: yat 0.x+yat 0.17
Owner: changed from Jari Häkkinen to Peter
Status: newaccepted

comment:2 Changed 6 weeks ago by Peter

Resolution: fixed
Status: acceptedclosed

In 3804:

closes #904; turn on cxx11 features by default

Note: See TracTickets for help on using tickets.