diff --git a/CMakeLists.txt b/CMakeLists.txt index cbf0feb..013ebad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,27 +29,6 @@ option( ${PROJECT_IS_TOP_LEVEL} ) -# [CPP.NO_FLAG_FORKING] -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - set(BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS - "[[msvc::no_unique_address]]" - CACHE STRING - "Name of C++ attribute for empty base optimization of data members" - ) -else() - set(BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS - "[[no_unique_address]]" - CACHE STRING - "Name of C++ attribute for empty base optimization of data members" - ) -endif() - -configure_file( - include/beman/any_view/config.hpp.in - include/beman/any_view/config.hpp - @ONLY -) - # [CMAKE.LIBRARY_NAME] add_library(beman.any_view INTERFACE) # [CMAKE.LIBRARY_ALIAS] @@ -68,10 +47,8 @@ target_sources( PUBLIC FILE_SET HEADERS BASE_DIRS # - ${CMAKE_CURRENT_BINARY_DIR}/include include FILES - ${CMAKE_CURRENT_BINARY_DIR}/include/beman/any_view/config.hpp include/beman/any_view/detail/any_iterator.hpp include/beman/any_view/detail/concepts.hpp include/beman/any_view/detail/intrusive_small_ptr.hpp diff --git a/include/beman/any_view/config.hpp.in b/include/beman/any_view/config.hpp.in deleted file mode 100644 index ebe6f4b..0000000 --- a/include/beman/any_view/config.hpp.in +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#ifndef BEMAN_ANY_VIEW_CONFIG_HPP -#define BEMAN_ANY_VIEW_CONFIG_HPP - -#define BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS() @BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS@ - -#endif // BEMAN_ANY_VIEW_CONFIG_HPP diff --git a/include/beman/any_view/detail/any_iterator.hpp b/include/beman/any_view/detail/any_iterator.hpp index 08a9294..07f81b3 100644 --- a/include/beman/any_view/detail/any_iterator.hpp +++ b/include/beman/any_view/detail/any_iterator.hpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include namespace beman::any_view::detail { diff --git a/include/beman/any_view/detail/iterator_adaptor.hpp b/include/beman/any_view/detail/iterator_adaptor.hpp index 01354a4..8a3f37e 100644 --- a/include/beman/any_view/detail/iterator_adaptor.hpp +++ b/include/beman/any_view/detail/iterator_adaptor.hpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include diff --git a/include/beman/any_view/detail/no_unique_address.hpp b/include/beman/any_view/detail/no_unique_address.hpp new file mode 100644 index 0000000..670b595 --- /dev/null +++ b/include/beman/any_view/detail/no_unique_address.hpp @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef BEMAN_ANY_VIEW_DETAIL_NO_UNIQUE_ADDRESS_HPP +#define BEMAN_ANY_VIEW_DETAIL_NO_UNIQUE_ADDRESS_HPP + +#ifndef BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS +#if _MSC_VER +#define BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS() [[msvc::no_unique_address]] +#else +#define BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS() [[no_unique_address]] +#endif // _MSC_VER +#endif // BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS + +#endif // BEMAN_ANY_VIEW_DETAIL_NO_UNIQUE_ADDRESS_HPP diff --git a/include/beman/any_view/detail/unique_address.hpp b/include/beman/any_view/detail/unique_address.hpp deleted file mode 100644 index b2afc8d..0000000 --- a/include/beman/any_view/detail/unique_address.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#ifndef BEMAN_ANY_VIEW_DETAIL_UNIQUE_ADDRESS_HPP -#define BEMAN_ANY_VIEW_DETAIL_UNIQUE_ADDRESS_HPP - -#ifdef __has_include -#if __has_include() -#include -#endif // __has_include() -#endif // __has_include - -// if the config.hpp file does not exist because this is in godbolt -// or another context where cmake is not run, default to the correct -// answer. -#ifndef BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS -#if _MSC_VER -#define BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS() [[msvc::no_unique_address]] -#else -#define BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS() [[no_unique_address]] -#endif // _MSC_VER -#endif // BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS - -#endif // BEMAN_ANY_VIEW_DETAIL_UNIQUE_ADDRESS_HPP diff --git a/include/beman/any_view/detail/view_adaptor.hpp b/include/beman/any_view/detail/view_adaptor.hpp index e04895f..1cf604b 100644 --- a/include/beman/any_view/detail/view_adaptor.hpp +++ b/include/beman/any_view/detail/view_adaptor.hpp @@ -3,7 +3,7 @@ #ifndef BEMAN_ANY_VIEW_DETAIL_VIEW_ADAPTOR_HPP #define BEMAN_ANY_VIEW_DETAIL_VIEW_ADAPTOR_HPP -#include +#include #include namespace beman::any_view::detail {