Skip to content

Commit 04c1690

Browse files
committed
Checkpoint
1 parent fa788d5 commit 04c1690

9 files changed

Lines changed: 42 additions & 24 deletions

File tree

.clang-format

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
2+
# Do not edit this file directly - it will be overwritten when templates are regenerated
3+
14
# Format style options described here:
25
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
36

@@ -49,7 +52,7 @@ BreakConstructorInitializers: AfterColon
4952
BreakAfterJavaFieldAnnotations: false
5053
BreakStringLiterals: false
5154
ColumnLimit: 100
52-
CommentPragmas: '^ IWYU pragma:'
55+
CommentPragmas: "^ IWYU pragma:"
5356
CompactNamespaces: false
5457
ConstructorInitializerAllOnOneLineOrOnePerLine: false
5558
ConstructorInitializerIndentWidth: 4
@@ -59,28 +62,28 @@ DerivePointerAlignment: false
5962
DisableFormat: false
6063
ExperimentalAutoDetectBinPacking: false
6164
FixNamespaceComments: true
62-
ForEachMacros:
65+
ForEachMacros:
6366
- foreach
6467
- Q_FOREACH
6568
- BOOST_FOREACH
66-
IncludeBlocks: Preserve
67-
IncludeCategories:
68-
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
69-
Priority: 2
70-
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
71-
Priority: 3
72-
- Regex: '.*'
73-
Priority: 1
74-
IncludeIsMainRegex: '$'
69+
IncludeBlocks: Preserve
70+
IncludeCategories:
71+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
72+
Priority: 2
73+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
74+
Priority: 3
75+
- Regex: ".*"
76+
Priority: 1
77+
IncludeIsMainRegex: "$"
7578
IndentCaseLabels: true
7679
IndentPPDirectives: None # Other option is AfterHash, which indents top level includes as well
7780
IndentWidth: 4
7881
IndentWrappedFunctionNames: true
7982
JavaScriptQuotes: Leave
8083
JavaScriptWrapImports: true
8184
KeepEmptyLinesAtTheStartOfBlocks: false
82-
MacroBlockBegin: ''
83-
MacroBlockEnd: ''
85+
MacroBlockBegin: ""
86+
MacroBlockEnd: ""
8487
MaxEmptyLinesToKeep: 1
8588
NamespaceIndentation: None
8689
ObjCBlockIndentWidth: 4
@@ -116,4 +119,3 @@ Language: Cpp
116119
---
117120
Language: ObjC
118121
PointerAlignment: Right
119-
...

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
2+
# Do not edit this file directly - it will be overwritten when templates are regenerated
3+
14
# Auto detect text files and perform LF normalization
25
* text=auto

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
2+
# Do not edit this file directly - it will be overwritten when templates are regenerated
3+
14
name: CI
25

36
on:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
2+
# Do not edit this file directly - it will be overwritten when templates are regenerated
3+
14
/.cpm-cache
25
/.cache
36
/build

.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"_comment": "Auto-generated from cpp-library (https://github.com/stlab/cpp-library) - Do not edit this file directly",
23
"recommendations": [
34
"matepek.vscode-catch2-test-adapter",
45
"llvm-vs-code-extensions.vscode-clangd",

CMakePresets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"generator": "Ninja",
1010
"cacheVariables": {
1111
"CMAKE_BUILD_TYPE": "Release",
12+
"BUILD_TESTING": "OFF",
1213
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
1314
"CMAKE_CXX_EXTENSIONS": "OFF"
1415
}

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!DOCTYPE html>
2+
<!-- Auto-generated from cpp-library (https://github.com/stlab/cpp-library) - Do not edit this file directly -->
23
<html>
34
<!-- Open or preview this file after building the docs to view the documentation. -->
45

Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#define DOCTEST_CONFIG_IMPLEMENT
2-
#include <doctest/doctest.h> // DOCTEST_CONFIG_IMPLEMENT
1+
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
2+
#include <doctest/doctest.h>
33

4-
/// [EXAMPLE]
5-
#include <stlab/enum_ops.hpp>
4+
#include <stlab/enum_ops.hpp> /// [EXAMPLE_START]
65

76
#include <iostream>
87

98
enum foo { foo_4 = 1 << 2, foo_8 = 1 << 3 };
109
enum class views : int { none = 0, text = 1 << 0, icon = 1 << 1, preview = 1 << 2 };
1110

1211
auto stlab_enable_bitmask_enum(foo) -> std::true_type;
13-
auto stlab_enable_bitmask_enum(views) -> std::true_type;
14-
12+
auto stlab_enable_bitmask_enum(views) -> std::true_type; /// [OMIT_START]
13+
void run_example() {
14+
/// [OMIT_END] \
1515
int main() {
1616
// Bitset operations on plain enums
1717
foo a{foo_4};
@@ -24,7 +24,6 @@ int main() {
2424
bool has_text = (x & views::text) == views::text;
2525
bool has_preview = (x & views::preview) == views::preview;
2626
std::cout << has_text << " " << has_preview << "\n";
27-
}
28-
/// [EXAMPLE]
27+
} /// [EXAMPLE_END]
2928

30-
TEST_CASE("Example: common use cases") { CHECK_NOTHROW(main()); }
29+
TEST_CASE("Example: common use cases") { CHECK_NOTHROW(run_example()); }

include/stlab/enum_ops.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@
5353
5454
The following is an example of code that will compile:
5555
56-
\snippet enum_ops_example.cpp EXAMPLE
56+
\dontinclude enum_ops_example.cpp
57+
\skip EXAMPLE_START
58+
\until OMIT_START
59+
\skip OMIT_END
60+
\until EXAMPLE_END
61+
5762
5863
The following is contains an example of code that will not compile
5964
since the typesafe operators have not been defined.

0 commit comments

Comments
 (0)