File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
include/beman/inplace_vector Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,18 @@ option(
2727 ${PROJECT_IS_TOP_LEVEL}
2828)
2929
30+ option(
31+ BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS
32+ "Disable exceptions by replacing throw calls with abort. Default : OFF. Values: { ON, OFF }."
33+ OFF
34+ )
35+
36+ configure_file(
37+ "${PROJECT_SOURCE_DIR}/include/beman/inplace_vector/config.hpp.in"
38+ "${PROJECT_BINARY_DIR}/include/beman/inplace_vector/config.hpp"
39+ @ONLY
40+ )
41+
3042include (FetchContent)
3143include (GNUInstallDirs)
3244
@@ -38,6 +50,7 @@ target_include_directories(
3850 beman.inplace_vector
3951 INTERFACE
4052 $< BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR}/include>
53+ $< BUILD_INTERFACE :${CMAKE_CURRENT_BINARY_DIR}/include>
4154 $< INSTALL_INTERFACE :include>
4255)
4356
Original file line number Diff line number Diff line change 1+ #ifndef BEMAN_INPLACE_VECTOR_CONFIG_HPP
2+ #define BEMAN_INPLACE_VECTOR_CONFIG_HPP
3+
4+ #cmakedefine01 BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS()
5+
6+ #endif
Original file line number Diff line number Diff line change 22
33#ifndef BEMAN_INPLACE_VECTOR_INPLACE_VECTOR_HPP
44#define BEMAN_INPLACE_VECTOR_INPLACE_VECTOR_HPP
5+ #include < beman/inplace_vector/config.hpp>
56
67#include < algorithm> // for rotate...
78#include < array>
2223#define IV_EXPECT (EXPR )
2324
2425#ifndef BEMAN_IV_THROW_OR_ABORT
25- #if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L
26+ #if !defined(__cpp_exceptions) || __cpp_exceptions < 199711L || \
27+ BEMAN_INPLACE_VECTOR_NO_EXCEPTIONS ()
2628#include < cstdlib> // for abort
2729#define BEMAN_IV_THROW_OR_ABORT (x ) abort()
2830#else
You can’t perform that action at this time.
0 commit comments