JASL  [1.2.0]-2018-09-11
Macros
jasl_common.hpp File Reference

Go to the source code of this file.

Macros

#define JASL_INNER_STR(x)   #x
 
#define JASL_STR(x)   JASL_INNER_STR(x)
 
#define JASL_VERSION_MAJOR   1
 
#define JASL_VERSION_MINOR   2
 
#define JASL_VERSION_PATCH   0
 
#define JASL_VERSION_LABEL   ""
 
#define JASL_VERSION_DATE   "2018-09-11"
 
#define JASL_VERSION_STR
 
#define JASL_THROW(exception)   throw(exception)
 
#define JASL_ASSERT(...)
 
#define JASL_USE_JASL_STRING_VIEW_AS_BASE
 
#define JASL_USE_STD_STRING_VIEW_AS_BASE
 
#define JASL_SUPPORT_STD_TO_JASL
 
#define JASL_SUPPORT_JASL_TO_STD
 
#define JASL_TERMINATE_ON_EXCEPTION_ON
 
#define JASL_ASSERT_ON
 
#define JASL_TESTIFY_STD_STRING_VIEW_EXISTS
 
#define JASL_DISABLE_JASL_STRING_VIEW_HASH
 
#define JASL_FORCE_USE_MURMURHASH_HASH
 

Macro Definition Documentation

◆ JASL_ASSERT_ON

#define JASL_ASSERT_ON

This macro is recommended to be defined during development and testing. It helps identify unproper use of the library.

◆ JASL_DISABLE_JASL_STRING_VIEW_HASH

#define JASL_DISABLE_JASL_STRING_VIEW_HASH

If this macro is provided, then jasl::nonstd::string_view has no std::hash specialization. The user can manually add one.

◆ JASL_FORCE_USE_MURMURHASH_HASH

#define JASL_FORCE_USE_MURMURHASH_HASH

In case of this macro if the std::string_view is provided jasl::nonstd::string_view still will use murmurhash.

◆ JASL_SUPPORT_JASL_TO_STD

#define JASL_SUPPORT_JASL_TO_STD

If this macro is provided, JASL classes will support conversion to STD classes.

◆ JASL_SUPPORT_STD_TO_JASL

#define JASL_SUPPORT_STD_TO_JASL

If this macro is provided, JASL classes will support construction and assign operations from STD classes.

◆ JASL_TERMINATE_ON_EXCEPTION_ON

#define JASL_TERMINATE_ON_EXCEPTION_ON

There are a few functions which can throw. (The design reason is the similarity to STD.) The exceptions are easily avoidable. Defining this macro will result of a call of std::terminate instead of throwing an exception.

Note: If this is defined, the tests will terminate when they test the exceptions.

◆ JASL_TESTIFY_STD_STRING_VIEW_EXISTS

#define JASL_TESTIFY_STD_STRING_VIEW_EXISTS

This macro can be useful, if the JASL library couldn't recognise the the existing std::string_view.

Remarks: This macro defines JASL_cpp_lib_string_view to 201606. This result can be achieved with defining JASL_cpp_lib_string_view manually.

◆ JASL_USE_JASL_STRING_VIEW_AS_BASE

#define JASL_USE_JASL_STRING_VIEW_AS_BASE

using jasl::string_view = jasl::nonstd::string_view;

The result of this that jasl::static_string and jasl::string will use it its funtionality. jasl::nonstd::string_view will be used even if std::string_view is possible to use (C++17).

Remarks: If none of JASL_USE_JASL_STRING_VIEW_AS_BASE and JASL_USE_STD_STRING_VIEW_AS_BASE are defined: If you have no std::string_view, JASL_USE_JASL_STRING_VIEW_AS_BASE will be defined automatically.

◆ JASL_USE_STD_STRING_VIEW_AS_BASE

#define JASL_USE_STD_STRING_VIEW_AS_BASE

using jasl::string_view = std::string_view;

The result of this that jasl::static_string and jasl::string will use it its funtionality If it is not possible, the source won't fallback to jasl::nonstd::string_view.

Remarks: If none of JASL_USE_JASL_STRING_VIEW_AS_BASE and JASL_USE_STD_STRING_VIEW_AS_BASE are defined: If you have no std::string_view, JASL_USE_JASL_STRING_VIEW_AS_BASE will be defined automatically.

◆ JASL_VERSION_STR

#define JASL_VERSION_STR
Value:
JASL_STR(JASL_VERSION_MAJOR) \
"." JASL_STR(JASL_VERSION_MINOR) "." JASL_STR(JASL_VERSION_PATCH) \
JASL_VERSION_LABEL " (" JASL_VERSION_DATE ")"