Skip to content

Commit 47ce759

Browse files
authored
25 fix godbolt (#28)
* drive-by improvement to git ignore * refactor unique_address logic into a single location * handle the case where config.hpp isn't generated (aka godbolt) * drive-by update to 3.28 which is needed for modules support * driveby: update ci to cmake 3.28 * fix trailing whitespace * revert 3.28 to make ci happy * attempt to satisfy clang-format lint ci * restructure the if-else for has_include
1 parent 2cde21f commit 47ce759

File tree

6 files changed

+33
-6
lines changed

6 files changed

+33
-6
lines changed

.github/workflows/ci_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Install Ninja
4242
uses: lukka/get-cmake@latest
4343
with:
44-
cmakeVersion: ~3.25.0
44+
cmakeVersion: ~3.28.0
4545
ninjaVersion: ^1.11.1
4646
- name: Setup MSVC
4747
if: startsWith(matrix.platform.os, 'windows')
@@ -104,7 +104,7 @@ jobs:
104104
- name: Setup build environment
105105
uses: lukka/get-cmake@latest
106106
with:
107-
cmakeVersion: ~3.25.0
107+
cmakeVersion: ~3.28.0
108108
ninjaVersion: ^1.11.1
109109
- name: Install Compiler
110110
id: install-compiler

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
22

33
/.cache
4-
/.vscode
54
/compile_commands.json
65
/build
6+
7+
# ignore emacs temp files
8+
*~
9+
\#*\#
10+
11+
# ignore vscode settings
12+
.vscode

include/beman/any_view/detail/any_iterator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#define BEMAN_ANY_VIEW_DETAIL_ANY_ITERATOR_HPP
55

66
#include <beman/any_view/concepts.hpp>
7-
#include <beman/any_view/config.hpp>
87
#include <beman/any_view/detail/intrusive_small_ptr.hpp>
98
#include <beman/any_view/detail/iterator_adaptor.hpp>
9+
#include <beman/any_view/detail/unique_address.hpp>
1010

1111
namespace beman::any_view::detail {
1212

include/beman/any_view/detail/iterator_adaptor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#ifndef BEMAN_ANY_VIEW_DETAIL_ITERATOR_ADAPTOR_HPP
44
#define BEMAN_ANY_VIEW_DETAIL_ITERATOR_ADAPTOR_HPP
55

6-
#include <beman/any_view/config.hpp>
76
#include <beman/any_view/detail/concepts.hpp>
87
#include <beman/any_view/detail/iterator_interface.hpp>
8+
#include <beman/any_view/detail/unique_address.hpp>
99
#include <beman/any_view/detail/utility.hpp>
1010

1111
#include <compare>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2+
3+
#ifndef BEMAN_ANY_VIEW_DETAIL_UNIQUE_ADDRESS_HPP
4+
#define BEMAN_ANY_VIEW_DETAIL_UNIQUE_ADDRESS_HPP
5+
6+
#if !defined(__has_include)
7+
# if __has_include(<beman/any_view/config.hpp>)
8+
# include <beman/any_view/config.hpp>
9+
# endif
10+
#else
11+
// if the config.hpp file does not exist because this is in godbolt
12+
// or another context where cmake is not run, default to the correct
13+
// answer.
14+
# if (_MSC_VER)
15+
# define BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS() [[msvc::no_unique_address]]
16+
# else
17+
# define BEMAN_ANY_VIEW_NO_UNIQUE_ADDRESS() [[no_unique_address]]
18+
# endif
19+
#endif
20+
21+
#endif

include/beman/any_view/detail/view_adaptor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef BEMAN_ANY_VIEW_DETAIL_VIEW_ADAPTOR_HPP
44
#define BEMAN_ANY_VIEW_DETAIL_VIEW_ADAPTOR_HPP
55

6-
#include <beman/any_view/config.hpp>
6+
#include <beman/any_view/detail/unique_address.hpp>
77
#include <beman/any_view/detail/view_interface.hpp>
88

99
namespace beman::any_view::detail {

0 commit comments

Comments
 (0)