Skip to content

Commit

Permalink
utf_explicit_output_iterator_t - for use with untyped output iterator…
Browse files Browse the repository at this point in the history
…s like std::back_inserter (#1)
  • Loading branch information
arturbac authored Jul 4, 2024
1 parent e19544c commit 2ab75bb
Show file tree
Hide file tree
Showing 16 changed files with 1,176 additions and 106 deletions.
138 changes: 138 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
BreakAfterAttributes: Always
BracedInitializerIndentWidth: 2
BraceWrapping:
SplitEmptyNamespace: false
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: false
AfterStruct: true
AfterExternBlock: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: true
SplitEmptyFunction: false
SplitEmptyRecord: false
BitFieldColonSpacing: Both
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Whitesmiths
BreakBeforeConceptDeclarations: Always
BreakBeforeInlineASMColon: Always
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: true
ColumnLimit: 120
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
IncludeBlocks: Preserve
IndentAccessModifiers: false
IndentCaseBlocks: true
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: false
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 2
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: true
InsertTrailingCommas: None
KeepEmptyLinesAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
Language: Cpp
LineEnding: DeriveLF
NamespaceIndentation: Inner
PPIndentWidth: 0
PackConstructorInitializers: CurrentLine
PointerAlignment: Middle
QualifierAlignment: Right
ReferenceAlignment: Middle
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: MultipleParentheses
RemoveSemicolon: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 1
SortIncludes: Never
SortUsingDeclarations: Lexicographic
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Both
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: true
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInParensOptions:
InCStyleCasts: false
InConditionalStatements: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 2
UseTab: Never
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignConsecutiveDeclarations:
Enabled: false
AlignConsecutiveMacros:
Enabled: false
AlignConsecutiveShortCaseStatements:
Enabled: true
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments:
Kind: Always
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
AlignAfterOpenBracket: BlockIndent
WhitespaceSensitiveMacros:
- PRAGMA_CLANG_WARNING_OFF
- PRAGMA_CLANG_WARNING_PUSH_OFF
- PRAGMA_GCC_WARNING_PUSH_OFF
- PRAGMA_GCC_WARNING_OFF
27 changes: 27 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Checks: 'clang-diagnostic-*,clang-analyzer-*,cppcoreguidelines-*,modernize-*,bugprone-*,readability-identifier-naming,-modernize-use-trailing-return-type,misc-const-correctness'
CheckOptions:
# General Naming Convention: lower_case
- key: readability-identifier-naming.NamespaceCase
value: 'lower_case'
- key: readability-identifier-naming.ClassCase
value: 'lower_case'
- key: readability-identifier-naming.StructCase
value: 'lower_case'
- key: readability-identifier-naming.FunctionCase
value: 'lower_case'
- key: readability-identifier-naming.VariableCase
value: 'lower_case'
- key: readability-identifier-naming.PublicMemberCase
value: 'lower_case'
- key: readability-identifier-naming.PrivateMemberCase
value: 'lower_case'
- key: readability-identifier-naming.ProtectedMemberCase
value: 'lower_case'
- key: readability-identifier-naming.ConstantCase
value: 'lower_case'
# Member variables should end with '_'
- key: readability-identifier-naming.MemberSuffix
value: '_'
# Macros should be UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionCase
value: 'UPPER_CASE'
60 changes: 30 additions & 30 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@ name: CMake

on:
push:
branches: [ master ]
branches: [ "master" ]
paths-ignore:
- 'README.md'
- 'docs/**'

pull_request:
branches: [ master ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CXX_COMPILER : clang-12
branches: [ "master" ]
paths-ignore:
- 'README.md'
- 'docs/**'

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest

build-and-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# install dependencies
- name: boost
run: sudo apt-get update && sudo apt-get install -yq libboost-dev libboost-test-dev

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}} -DCMAKE_CXX_FLAGS="-fuse-ld=lld" -DLINK_FLAGS="-fuse-ld=lld"
- name: Add LLVM Repository
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc-14 g++-14 cmake ninja-build clang-18 libfmt-dev libc++-18-dev libc++abi-18-dev
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: tests clang-18-release
run: cmake --workflow --preset="clang-18-release"

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
- name: tests clang-18-libc++release
run: cmake --workflow --preset="clang-18-libc++release"

- name: tests gcc-14-release
run: cmake --workflow --preset="gcc-14-release"
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

build*
.cache*
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.23)

project(stralgo
VERSION 1.2.1
VERSION 1.3.0
LANGUAGES CXX
HOMEPAGE_URL "https://github.com/arturbac/stralgo"
)
Expand Down Expand Up @@ -36,7 +36,7 @@ CPMAddPackage(
CPMAddPackage(
small_vectors
GITHUB_REPOSITORY arturbac/small_vectors
GIT_TAG v3.1.1
GIT_TAG v3.1.6
)

if( PROJECT_IS_TOP_LEVEL )
Expand Down
Loading

0 comments on commit 2ab75bb

Please sign in to comment.