Skip to content

Commit

Permalink
[#1] Add Span implementation from Zserio C++ runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Mi-La committed Aug 27, 2024
1 parent 8c35340 commit ff5018f
Show file tree
Hide file tree
Showing 5 changed files with 767 additions and 0 deletions.
29 changes: 29 additions & 0 deletions runtime/ClangTidySuppressions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# This is necessary for low level implementation of Span to mimic standard C++20 'std::span' abstraction.
cppcoreguidelines-avoid-c-arrays:src/zserio/Span.h:112
cppcoreguidelines-avoid-c-arrays:src/zserio/Span.h:123
cppcoreguidelines-avoid-c-arrays:src/zserio/Span.h:136
cppcoreguidelines-avoid-c-arrays:src/zserio/Span.h:148
cppcoreguidelines-avoid-c-arrays:src/zserio/Span.h:161
cppcoreguidelines-avoid-c-arrays:src/zserio/Span.h:174

# This is necessary for low level implementation of Span to mimic standard C++20 'std::span' abstraction.
cppcoreguidelines-pro-bounds-array-to-pointer-decay:src/zserio/Span.h:113

# This is necessary for low level implementation of Span to mimic standard C++20 'std::span' abstraction.
google-explicit-constructor:src/zserio/Span.h:112
google-explicit-constructor:src/zserio/Span.h:125
google-explicit-constructor:src/zserio/Span.h:138
google-explicit-constructor:src/zserio/Span.h:150
google-explicit-constructor:src/zserio/Span.h:163
google-explicit-constructor:src/zserio/Span.h:176

# False positive, this is a template method.
modernize-use-equals-default:src/zserio/Span.h:80

# Intentional tests.
google-explicit-constructor:test/zserio/BuiltInOperatorsTest.cpp:25

# Intentional tests.
cppcoreguidelines-avoid-c-arrays:test/zserio/SpanTest.cpp:45

# Intentional tests.
cppcoreguidelines-pro-bounds-pointer-arithmetic:test/zserio/SpanTest.cpp:34
cppcoreguidelines-pro-bounds-pointer-arithmetic:test/zserio/SpanTest.cpp:38
1 change: 1 addition & 0 deletions runtime/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set(ZSERIO_CPP17_RUNTIME_LIB_SRCS
zserio/BuiltInOperators.cpp
zserio/BuiltInOperators.h
zserio/CppRuntimeVersion.h
zserio/Span.h
zserio/Types.h
)

Expand Down
Loading

0 comments on commit ff5018f

Please sign in to comment.