├── .clang-format ├── .git-blame-ignore-revs ├── .gitattributes ├── .github └── workflows │ └── push-pull_request.yml ├── .gitignore ├── .readthedocs.yml ├── .style.yapf ├── CMakeLists.txt ├── CMakePresets.json ├── LICENSE.md ├── README.md ├── benchmarks ├── CMakeLists.txt └── bit │ ├── CMakeLists.txt │ ├── graph_config.json │ ├── opaque │ ├── CMakeLists.txt │ ├── include │ │ └── opaque │ │ │ ├── opaque.hpp │ │ │ └── version.hpp │ └── source │ │ └── opaque.cpp │ └── source │ ├── count.cpp │ ├── find.cpp │ ├── is_sorted.cpp │ ├── is_sorted_until.cpp │ ├── main.cpp │ └── noop.cpp ├── cmake ├── identify_stdlib.cmake ├── ztd.idk-config.cmake.in ├── ztd.tag_invoke-config.cmake.in └── ztd.version-config.cmake.in ├── documentation ├── CMakeLists.txt ├── Doxyfile.in ├── requirements.txt └── source │ ├── _static │ └── inline_removal.js │ ├── api.rst │ ├── api │ ├── alignment.rst │ ├── assert.rst │ ├── charN_t.rst │ ├── ebco.rst │ ├── empty_string.rst │ ├── endian.rst │ ├── hijack.rst │ ├── span.rst │ ├── tag.rst │ ├── tag_invoke.rst │ ├── to_address.rst │ ├── type_traits │ │ ├── detection.rst │ │ ├── is_character.rst │ │ └── type_identity.rst │ ├── uninit.rst │ └── unwrap.rst │ ├── benchmarks.rst │ ├── benchmarks │ └── bit.rst │ ├── bibliography.rst │ ├── c_api │ ├── alignment.rst │ ├── assert.rst │ ├── bit.intrinsic.rst │ ├── bit.memreverse.rst │ ├── bit.store_load.rst │ ├── c_span.rst │ ├── charN_t.rst │ ├── endian.rst │ └── extent.rst │ ├── conf.py │ ├── config.rst │ ├── definitions.rst │ ├── future.rst │ ├── genindex.rst │ ├── images │ └── benchmarks │ │ └── bit │ │ ├── count.png │ │ ├── find.png │ │ ├── is_sorted.png │ │ └── is_sorted_until.png │ ├── in the wild.rst │ ├── index.rst │ └── license.rst ├── examples └── CMakeLists.txt ├── include └── ztd │ ├── epilogue.hpp │ ├── idk.h │ ├── idk.hpp │ ├── idk │ ├── align.h │ ├── align.hpp │ ├── assert.h │ ├── assert.hpp │ ├── assume_aligned.h │ ├── assume_aligned.hpp │ ├── auto.h │ ├── basic_c_string_view.hpp │ ├── binary_digits.hpp │ ├── bit.h │ ├── bit.hpp │ ├── bit_width_to_max_value.h │ ├── c_span.g.h │ ├── c_span.h │ ├── c_string_view.hpp │ ├── charN_t.h │ ├── charN_t.hpp │ ├── char_traits.hpp │ ├── construct_destroy.hpp │ ├── contiguous_iterator_tag.hpp │ ├── declval.h │ ├── detail │ │ ├── api.h │ │ ├── bit.intrinsic.generic.h │ │ ├── bit.intrinsic.h │ │ ├── bit.load_store.h │ │ ├── bit.load_store.impl.h │ │ ├── bit.memreverse.h │ │ ├── bit.memreverse.impl.h │ │ ├── doxygen_type.h │ │ ├── mark_contiguous.hpp │ │ ├── math.hpp │ │ ├── posix.hpp │ │ ├── span.implementation.hpp │ │ ├── unicode.h │ │ ├── unicode.hpp │ │ ├── windows.h │ │ └── windows.hpp │ ├── ebco.hpp │ ├── empty_string.hpp │ ├── encoding_detection.h │ ├── encoding_detection.hpp │ ├── encoding_name.h │ ├── encoding_name.hpp │ ├── endian.h │ ├── endian.hpp │ ├── explicit.hpp │ ├── extent.h │ ├── generic.h │ ├── generic.hpp │ ├── hash.hpp │ ├── hijack.hpp │ ├── is_array.hpp │ ├── mbstate_t.h │ ├── mbstate_t.hpp │ ├── null.h │ ├── reference_wrapper.hpp │ ├── restrict.h │ ├── size.h │ ├── size.hpp │ ├── span.hpp │ ├── statement_expressions.h │ ├── statement_expressions.hpp │ ├── static_assert.h │ ├── static_assert.hpp │ ├── tag.hpp │ ├── text_encoding_id.hpp │ ├── thread_local.h │ ├── to_address.hpp │ ├── to_mutable_iter.hpp │ ├── to_underlying.hpp │ ├── type_traits.hpp │ ├── typeof.h │ ├── uninit.hpp │ ├── unreachable.h │ ├── unreachable.hpp │ ├── unwrap.hpp │ ├── utf8_locale.h │ ├── utf8_startup_hook.hpp │ ├── version.h │ └── version.hpp │ ├── prologue.hpp │ ├── ranges │ ├── adl.hpp │ ├── algorithm.hpp │ ├── blackhole_iterator.hpp │ ├── byte_iterator.hpp │ ├── counted_iterator.hpp │ ├── default_sentinel.hpp │ ├── detail │ │ ├── byte_iterator.hpp │ │ └── insert_bulk.hpp │ ├── from_range.hpp │ ├── insert_bulk.hpp │ ├── iterator.hpp │ ├── range.hpp │ ├── reconstruct.hpp │ ├── repeat.hpp │ ├── save_iterator.hpp │ ├── save_range.hpp │ ├── subrange.hpp │ ├── unbounded.hpp │ ├── unreachable_sentinel.hpp │ ├── version.hpp │ ├── view.hpp │ ├── word_iterator.hpp │ └── wrapped_pointer.hpp │ ├── tag_invoke.hpp │ ├── tag_invoke │ ├── tag_invoke.hpp │ ├── tag_t.hpp │ └── version.hpp │ ├── tests │ ├── basic_unicode_strings.h │ ├── basic_unicode_strings.hpp │ ├── bit_constant.h │ ├── bit_constant.hpp │ ├── compare_each.hpp │ ├── keep_process_awake.hpp │ └── types.hpp │ ├── version.h │ ├── version.hpp │ └── version │ ├── detail │ ├── api.h │ ├── is.h │ ├── vc++.codepage_to_name.h │ ├── version.c++.hpp │ └── version.c.h │ ├── version.h │ └── version.hpp ├── single └── CMakeLists.txt ├── source └── ztd │ └── idk │ ├── bit.intrinsic.cpp │ ├── bit.load_store.c │ ├── bit.memreverse.c │ ├── detail │ └── windows.cpp │ ├── encoding_detection.c++.cpp │ ├── encoding_detection.c.cpp │ ├── encoding_name.c.cpp │ ├── size.extern_inline.c │ └── utf8_locale.cpp └── tests ├── CMakeLists.txt ├── idk ├── CMakeLists.txt ├── basic_compile_time │ ├── CMakeLists.txt │ └── source │ │ ├── bit.load_store.cpp │ │ ├── bit.memreverse.cpp │ │ └── main.cpp ├── basic_run_time_c++ │ ├── CMakeLists.txt │ └── source │ │ ├── bit.intrinsic.c.cpp │ │ ├── bit.intrinsic.cpp │ │ ├── bit.load_store.8.no-alias.cpp │ │ ├── bit.load_store.cpp │ │ ├── bit.memreverse.8.no-alias.c.cpp │ │ ├── bit.memreverse.8.no-alias.cpp │ │ ├── bit.memreverse.c.cpp │ │ ├── bit.memreverse.cpp │ │ ├── c_span.cpp │ │ ├── encoding_name.cpp │ │ └── main.cpp ├── basic_run_time_c │ ├── CMakeLists.txt │ └── source │ │ ├── bit.intrinsic.c │ │ ├── bit.memreverse.c │ │ ├── bit.rotate.c │ │ ├── c_span.c │ │ ├── c_test.h │ │ ├── encoding_name.c │ │ └── main.c ├── constexpr_inline_struggles │ ├── CMakeLists.txt │ ├── include │ │ └── uses_size.h │ └── source │ │ ├── c_foo.c │ │ ├── main.c │ │ ├── uses_size.c │ │ ├── uses_size.cpp │ │ └── uses_size_again.c └── inclusion │ └── CMakeLists.txt ├── ranges ├── CMakeLists.txt └── inclusion │ └── CMakeLists.txt ├── shared └── include │ └── ztd │ └── idk │ └── tests │ └── unused_declaration.h ├── tag_invoke ├── CMakeLists.txt └── inclusion │ └── CMakeLists.txt └── version ├── CMakeLists.txt └── inclusion └── CMakeLists.txt /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: WebKit 3 | IndentWidth: 5 4 | TabWidth: 5 5 | ContinuationIndentWidth: 5 6 | UseTab: ForIndentation 7 | 8 | # Namespaces 9 | NamespaceIndentation: All 10 | CompactNamespaces: true 11 | FixNamespaceComments: true 12 | 13 | # Overall Alignment 14 | ColumnLimit: 120 15 | AlignAfterOpenBracket: DontAlign # uses ContinuationIndentWidth for this instead 16 | AccessModifierOffset: -5 # do not push public: or private: around 17 | AlignConsecutiveAssignments: true # affects more than what's expected: do not use 18 | #AlignConsecutiveDeclarations: true # affects more than what's expected: do not use 19 | 20 | # Type Alignment 21 | DerivePointerAlignment: false 22 | PointerAlignment: Left 23 | AlwaysBreakTemplateDeclarations: true 24 | AlwaysBreakBeforeMultilineStrings: true 25 | 26 | # Comments 27 | AlignTrailingComments: true 28 | ReflowComments: true 29 | 30 | # Macros 31 | AlignEscapedNewlines: Left 32 | #IndentPPDirectives: None 33 | 34 | # Functions 35 | AllowShortFunctionsOnASingleLine: None 36 | AlwaysBreakAfterReturnType: None 37 | BreakConstructorInitializers: BeforeComma 38 | ConstructorInitializerIndentWidth: 0 39 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 40 | BinPackArguments: true 41 | BinPackParameters: true 42 | 43 | # Classes 44 | BreakBeforeInheritanceComma: false 45 | 46 | # Braces 47 | Cpp11BracedListStyle: false 48 | BreakBeforeBraces: Custom 49 | BraceWrapping: 50 | AfterEnum: false 51 | AfterStruct: false 52 | AfterUnion: false 53 | AfterControlStatement: false 54 | AfterClass: false 55 | AfterNamespace: false 56 | BeforeElse: true 57 | BeforeCatch: true 58 | IndentBraces: false 59 | SplitEmptyFunction: false 60 | SplitEmptyRecord: false 61 | SplitEmptyNamespace: true 62 | 63 | # Control Statements 64 | AllowShortIfStatementsOnASingleLine: false 65 | AllowShortLoopsOnASingleLine: false 66 | AllowShortCaseLabelsOnASingleLine: false 67 | IndentCaseLabels: false 68 | 69 | # Spaces 70 | SpaceAfterCStyleCast: false 71 | SpacesInCStyleCastParentheses: false 72 | SpaceAfterTemplateKeyword: true 73 | SpaceBeforeAssignmentOperators: true 74 | SpaceBeforeParens: ControlStatements 75 | SpaceInEmptyParentheses: false 76 | SpacesInAngles: false 77 | SpacesInParentheses: false 78 | SpacesInSquareBrackets: false 79 | MaxEmptyLinesToKeep: 3 80 | 81 | # Prevent OCD 82 | SortIncludes: false 83 | 84 | --- 85 | Language: Cpp 86 | Standard: Cpp11 87 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # renormalize line endings 2 | a0ebca91846c7d40468f76c2ab7a8496256969d3 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/workflows/push-pull_request.yml: -------------------------------------------------------------------------------- 1 | name: Push & Pull Request Continuous Integration 2 | on: 3 | pull_request: 4 | types: [synchronize, opened, edited] 5 | push: 6 | 7 | env: 8 | CTEST_OUTPUT_ON_FAILURE: 1 9 | 10 | jobs: 11 | ci: 12 | name: "${{matrix.os}} ${{matrix.compiler}} c${{matrix.c_standard}} c++${{matrix.cxx_standard}}" 13 | strategy: 14 | matrix: 15 | os: 16 | - ubuntu 17 | - windows 18 | - macos 19 | compiler: 20 | - msvc 21 | - gcc 22 | - clang 23 | c_standard: 24 | - 17 25 | - 23 26 | cxx_standard: 27 | - 20 28 | - 23 29 | - 26 30 | exclude: 31 | - compiler: msvc 32 | os: ubuntu 33 | - compiler: msvc 34 | os: macos 35 | runs-on: ${{matrix.os}}-latest 36 | env: 37 | CMAKE_CXX_STANDARD: ${{matrix.cxx_standard}} 38 | CMAKE_C_STANDARD: ${{matrix.c_standard}} 39 | steps: 40 | # important setup 41 | - uses: actions/checkout@main 42 | with: 43 | submodules: recursive 44 | - uses: humbletim/vsdevenv-shell@main 45 | if: ${{matrix.os == 'windows'}} 46 | - uses: seanmiddleditch/gha-setup-ninja@master 47 | if: ${{matrix.os == 'windows'}} 48 | # actual runs 49 | - name: Execute CMake Workflow (Windows and MSVC) 50 | if: ${{(matrix.os == 'windows' && matrix.compiler == 'msvc')}} 51 | shell: vsdevenv x64 powershell {0} 52 | run: cmake --workflow --preset ${{matrix.compiler}} 53 | - name: Execute CMake Workflow (Non-Windows and Non-MSVC) 54 | if: ${{(matrix.os != 'windows' || matrix.compiler != 'msvc')}} 55 | run: cmake --workflow --preset ${{matrix.compiler}} 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | install/ 3 | scratch/ 4 | 5 | .cmake/ 6 | .mypy_cache/ 7 | .vscode/ 8 | .vs/ 9 | CMakeSettings.json 10 | CMakeUserPresets.json 11 | 12 | /main.cpp 13 | /*.hex 14 | __pycache__/ 15 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License"); you may not use this file except in compliance 18 | # with the License. You may obtain a copy of the License at 19 | # 20 | # https://www.apache.org/licenses/LICENSE-2.0 21 | # 22 | # Unless required by applicable law or agreed to in writing, software 23 | # distributed under the License is distributed on an "AS IS" BASIS, 24 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | # See the License for the specific language governing permissions and 26 | # limitations under the License. 27 | # 28 | # ============================================================================= 29 | 30 | # .readthedocs.yml 31 | # Read the Docs configuration file 32 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 33 | 34 | # Required 35 | version: 2 36 | 37 | build: 38 | image: latest 39 | apt_packages: 40 | - doxygen 41 | 42 | sphinx: 43 | builder: html 44 | configuration: documentation/source/conf.py 45 | 46 | formats: 47 | - pdf 48 | - epub 49 | 50 | python: 51 | install: 52 | - requirements: documentation/requirements.txt 53 | -------------------------------------------------------------------------------- /.style.yapf: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | [style] 32 | based_on_style = pep8 33 | use_tabs = true 34 | indent_width = 5 35 | column_limit = 100 36 | 37 | spaces_before_comment = 1 38 | spaces_around_power_operator = true 39 | space_between_ending_comma_and_closing_bracket = true 40 | 41 | continuation_align_style = SPACE 42 | split_before_first_argument = false 43 | split_complex_comprehension = true 44 | dedent_closing_brackets = false 45 | coalesce_brackets = true 46 | align_closing_bracket_with_visual_indent = false 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `ztd.idk` 2 | 3 | This is the IDK (Industrial Development Kit) library, part of the ZTD collection. The IDK is a small, useful toolbox of supplementary things, including: 4 | 5 | - The `ztd.idk` core library: 6 | - A small collection of type traits, optimizations, and other semi-niche utilities for accelerating development. 7 | - Small, header-only. 8 | - CMake: `ztd::idk` 9 | - The `ztd.tag_invoke` customization point library: 10 | - Modeled after C++ Proposal [P1985](https://wg21.link/p1895). 11 | - Makes for a single extension point to be written, `tag_invoke(...)`, whose first argument is the name of the extension point to be hooking into. E.g., `tag_invoke(tag_t, ...)`. 12 | - Tiny, header-only. 13 | - CMake: `ztd::tag_invoke` 14 | - The `ztd.version` configuration macro library: 15 | - A formalization of the principles found in [this post](https://thephd.dev/versioning-and-other-boilerplate) and [this post](https://thephd.dev/versioning-and-other-boilerplate-part-2). 16 | - Mistake-resistant configuration and default-on/off vs. deliberate on/off detection. 17 | - Infinitesimally tiny, header-only. 18 | - CMake: `ztd::version` 19 | - And more! 20 | 21 | All of these utilities should be header-only, and come with CMake build files for ease of use. Simply depend on `ztd::idk` or `ztd::tag_invoke`. You can find the [the library documentation here (https://ztdidk.rtfd.io)](https://ztdidk.rtfd.io/). 22 | -------------------------------------------------------------------------------- /benchmarks/bit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Dependencies 32 | # opaque library 33 | add_subdirectory(opaque) 34 | 35 | # # Benchmark Executable 36 | file(GLOB_RECURSE ztd.idk.benchmarks.bit.sources CONFIGURE_DEPENDS source/**) 37 | 38 | add_executable(ztd.idk.benchmarks.bit ${ztd.idk.benchmarks.bit.sources}) 39 | target_include_directories(ztd.idk.benchmarks.bit PRIVATE 40 | include 41 | ) 42 | target_link_libraries(ztd.idk.benchmarks.bit PRIVATE 43 | ztd::idk 44 | ztd::idk::benchmarks::opaque 45 | benchmark 46 | ${CMAKE_DL_LIBS} 47 | ) 48 | 49 | target_compile_options(ztd.idk.benchmarks.bit 50 | PRIVATE 51 | ${--utf8-literal-encoding} 52 | ${--utf8-source-encoding} 53 | ${--disable-permissive} 54 | ${--warn-pedantic} 55 | ${--warn-default} 56 | ${--warn-extra} 57 | ${--warn-errors} 58 | ${--allow-microsoft-enum-value} 59 | ) 60 | 61 | ztd_tools_add_benchmark_grapher( 62 | NAME 63 | bit 64 | CONFIG 65 | "${CMAKE_CURRENT_SOURCE_DIR}/graph_config.json" 66 | TARGETS 67 | ztd.idk.benchmarks.bit 68 | REPETITIONS 69 | ${ZTD_IDK_BENCHMARKS_REPETITIONS} 70 | ) 71 | -------------------------------------------------------------------------------- /benchmarks/bit/opaque/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Opaque Library 32 | file(GLOB_RECURSE ztd.idk.benchmarks.opaque.sources 33 | CONFIGURE_DEPENDS 34 | source/**.cpp source/**.c) 35 | 36 | add_library(ztd.idk.benchmarks.opaque SHARED ${ztd.idk.benchmarks.opaque.sources}) 37 | add_library(ztd::idk::benchmarks::opaque ALIAS ztd.idk.benchmarks.opaque) 38 | target_include_directories(ztd.idk.benchmarks.opaque 39 | PUBLIC 40 | include/ 41 | ) 42 | target_link_libraries(ztd.idk.benchmarks.opaque PRIVATE 43 | ztd::idk 44 | ${CMAKE_DL_LIBS} 45 | ) 46 | target_compile_definitions(ztd.idk.benchmarks.opaque 47 | PRIVATE 48 | ZTD_OPAQUE_BUILD=1 49 | ) 50 | target_compile_definitions(ztd.idk.benchmarks.opaque 51 | PUBLIC 52 | ZTD_OPAQUE_DLL=1 53 | ) 54 | target_compile_options(ztd.idk.benchmarks.opaque PRIVATE 55 | ${--utf8-literal-encoding} 56 | ${--utf8-source-encoding} 57 | ${--disable-permissive} 58 | ${--warn-pedantic} 59 | ${--warn-default} 60 | ${--warn-extra} 61 | ${--warn-errors} 62 | ) 63 | -------------------------------------------------------------------------------- /benchmarks/bit/opaque/include/opaque/opaque.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #ifndef ZTD_IDK_BENCHMARKS_OPAQUE_OPAQUE_HPP 32 | #define ZTD_IDK_BENCHMARKS_OPAQUE_OPAQUE_HPP 33 | 34 | #pragma once 35 | 36 | #include 37 | 38 | #include 39 | 40 | ZTD_OPAQUE_API_LINKAGE_I_ std::size_t opaque_benchmark_loop_limit(void) ZTD_USE(ZTD_NOEXCEPT_IF_CXX); 41 | 42 | ZTD_OPAQUE_API_LINKAGE_I_ std::size_t opaque_hardcoded_index(void) ZTD_USE(ZTD_NOEXCEPT_IF_CXX); 43 | 44 | ZTD_OPAQUE_API_LINKAGE_I_ bool opaque_true(void) ZTD_USE(ZTD_NOEXCEPT_IF_CXX); 45 | 46 | ZTD_OPAQUE_API_LINKAGE_I_ bool opaque_false(void) ZTD_USE(ZTD_NOEXCEPT_IF_CXX); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /benchmarks/bit/opaque/source/opaque.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | ZTD_OPAQUE_API_LINKAGE_I_ std::size_t opaque_benchmark_loop_limit() noexcept { 34 | return 400000; 35 | } 36 | 37 | 38 | ZTD_OPAQUE_API_LINKAGE_I_ std::size_t opaque_hardcoded_index() noexcept { 39 | return 95000; 40 | } 41 | 42 | ZTD_OPAQUE_API_LINKAGE_I_ bool opaque_true() noexcept { 43 | return true; 44 | } 45 | 46 | ZTD_OPAQUE_API_LINKAGE_I_ bool opaque_false() noexcept { 47 | return false; 48 | } 49 | -------------------------------------------------------------------------------- /benchmarks/bit/source/main.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | #include 34 | 35 | int main(int argc, char** argv) { 36 | ::benchmark::Initialize(&argc, argv); 37 | if (::benchmark::ReportUnrecognizedArguments(argc, argv)) { 38 | return 1; 39 | } 40 | ::benchmark::RunSpecifiedBenchmarks(); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /benchmarks/bit/source/noop.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | static void noop(benchmark::State& state) { 34 | std::size_t result = 0; 35 | for (auto _ : state) { 36 | result += 1; 37 | } 38 | if (result != static_cast(state.iterations())) { 39 | state.SkipWithError("no-op has failed: check fundamental assumptions!"); 40 | } 41 | } 42 | 43 | BENCHMARK(noop); 44 | -------------------------------------------------------------------------------- /cmake/ztd.idk-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | find_package(ztd.version CONFIG REQUIRED) 4 | find_package(ztd.tag_invoke CONFIG REQUIRED) 5 | include(${CMAKE_CURRENT_LIST_DIR}/ztd.idk-targets.cmake) 6 | 7 | if (TARGET ztd.idk) 8 | add_library(ztd::idk ALIAS ztd.idk) 9 | get_target_property(ZTD_IDK_INCLUDE_DIRS 10 | ztd.idk INTERFACE_INCLUDE_DIRECTORIES) 11 | set_and_check(ZTD_IDK_INCLUDE_DIRS "${ZTD_IDK_INCLUDE_DIRS}") 12 | endif() 13 | 14 | if(TARGET ztd::idk::single) 15 | get_target_property(ZTD_IDK_SINGLE_INCLUDE_DIRS 16 | ztd.idk.single INTERFACE_INCLUDE_DIRECTORIES) 17 | set_and_check(ZTD_IDK_INCLUDE_DIRS "${ZTD_IDK_SINGLE_INCLUDE_DIRS}") 18 | set(ZTD_IDK_LIBRARIES_SINGLE ztd::idk::single) 19 | endif() 20 | -------------------------------------------------------------------------------- /cmake/ztd.tag_invoke-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | find_package(ztd.version CONFIG REQUIRED) 4 | include(${CMAKE_CURRENT_LIST_DIR}/ztd.tag_invoke-targets.cmake) 5 | 6 | if (TARGET ztd.tag_invoke) 7 | add_library(ztd::tag_invoke ALIAS ztd.tag_invoke) 8 | get_target_property(ZTD_TAG_INVOKE_INCLUDE_DIRS 9 | ztd.tag_invoke INTERFACE_INCLUDE_DIRECTORIES) 10 | set_and_check(ZTD_TAG_INVOKE_INCLUDE_DIRS "${ZTD_TAG_INVOKE_INCLUDE_DIRS}") 11 | endif() 12 | 13 | if(TARGET ztd::tag_invoke::single) 14 | get_target_property(ZTD_TAG_INVOKE_SINGLE_INCLUDE_DIRS 15 | ztd.tag_invoke.single INTERFACE_INCLUDE_DIRECTORIES) 16 | set_and_check(ZTD_TAG_INVOKE_INCLUDE_DIRS "${ZTD_TAG_INVOKE_SINGLE_INCLUDE_DIRS}") 17 | set(ZTD_TAG_INVOKE_LIBRARIES_SINGLE ztd::tag_invoke::single) 18 | endif() 19 | -------------------------------------------------------------------------------- /cmake/ztd.version-config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/ztd.version-targets.cmake) 4 | 5 | if (TARGET ztd.version) 6 | add_library(ztd::version ALIAS ztd.version) 7 | get_target_property(ZTD_VERSION_INCLUDE_DIRS 8 | ztd.version INTERFACE_INCLUDE_DIRECTORIES) 9 | set_and_check(ZTD_VERSION_INCLUDE_DIRS "${ZTD_VERSION_INCLUDE_DIRS}") 10 | endif() 11 | 12 | if(TARGET ztd::version::single) 13 | get_target_property(ZTD_VERSION_SINGLE_INCLUDE_DIRS 14 | ztd.version.single INTERFACE_INCLUDE_DIRECTORIES) 15 | set_and_check(ZTD_VERSION_INCLUDE_DIRS "${ZTD_VERSION_SINGLE_INCLUDE_DIRS}") 16 | set(ZTD_VERSION_LIBRARIES_SINGLE ztd::version::single) 17 | endif() 18 | -------------------------------------------------------------------------------- /documentation/requirements.txt: -------------------------------------------------------------------------------- 1 | # Python requirements to generate documentation 2 | # Run: pip3 install -r requirements.txt 3 | breathe 4 | sphinx 5 | sphinx_rtd_theme 6 | sphinxcontrib_plantuml 7 | breathe 8 | myst_parser 9 | cmake 10 | ninja 11 | -------------------------------------------------------------------------------- /documentation/source/_static/inline_removal.js: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | $(document).ready(function () { 32 | $("em.property > span.pre:contains('inline')").hide(); 33 | }); 34 | -------------------------------------------------------------------------------- /documentation/source/api.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | API Reference 32 | ============= 33 | 34 | This is simply a listing of all the available pages containing various APIs, or links to pages that link to more API documentation. 35 | 36 | 37 | C++ APIs 38 | -------- 39 | 40 | .. toctree:: 41 | :maxdepth: 1 42 | :glob: 43 | 44 | api/* 45 | api/type_traits/* 46 | 47 | 48 | C APIs 49 | ------ 50 | 51 | .. toctree:: 52 | :maxdepth: 1 53 | :glob: 54 | 55 | c_api/* 56 | -------------------------------------------------------------------------------- /documentation/source/api/alignment.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Alignment 32 | ========= 33 | 34 | This API is identical to the one defined in the C APIs, which can be :doc:`found here`. 35 | -------------------------------------------------------------------------------- /documentation/source/api/assert.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | assertions 32 | ========== 33 | 34 | This API is identical to the one defined in the C APIs, which can be :doc:`found here`. 35 | -------------------------------------------------------------------------------- /documentation/source/api/charN_t.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | char(8/16/32)_t 32 | =============== 33 | 34 | This makes ``char(8/16/32)_t`` available under the type definitions of ``ztd::uchar(8/16/32)_t``. This allows their use uniformly in C and C++, regardless of whether or not the type definition is present in the proper place. 35 | 36 | .. doxygentypedef:: ztd::uchar8_t 37 | 38 | .. doxygentypedef:: ztd::uchar16_t 39 | 40 | .. doxygentypedef:: ztd::uchar32_t 41 | -------------------------------------------------------------------------------- /documentation/source/api/ebco.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | ebco 32 | ==== 33 | 34 | ``ebco`` is a way to gain the benefits of what is called the Empty Base Class Optimization (EBCO). It is meant to be used as a base class with the type and tag used to identify the member variable is replacing. Mostly superseded by ``[[no_unique_address]]``, except on one compiler that decided to make a Fractally Bad Decision™. 35 | 36 | 37 | .. doxygenclass:: ztd::ebco 38 | :members: 39 | -------------------------------------------------------------------------------- /documentation/source/api/empty_string.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | empty_string 32 | ============ 33 | 34 | Procures an empty string for the given character type. Specialized for: 35 | 36 | - ``char`` 37 | - ``signed char`` 38 | - ``unsigned char`` 39 | - ``char8_t`` 40 | - ``char16_t`` 41 | - ``char32_t`` 42 | 43 | .. doxygenfunction:: ztd::empty_string 44 | -------------------------------------------------------------------------------- /documentation/source/api/endian.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | endian 32 | ====== 33 | 34 | The endian enumeration is a very simple ``enum class`` used to communicate what kind of byte ordering certain parts of the library should use to interpret incoming byte sequences. The C version uses macros and can be found :doc:`here `. 35 | 36 | The values are ``ztd::endian::little``, ``ztd::endian::big``, or ``ztd::endian::native``. 37 | 38 | .. doxygentypedef:: ztd::endian 39 | -------------------------------------------------------------------------------- /documentation/source/api/hijack.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | hijack 32 | ====== 33 | 34 | .. doxygenclass:: ztd::hijack::token 35 | 36 | .. doxygenclass:: ztd_hijack_global_token 37 | -------------------------------------------------------------------------------- /documentation/source/api/span.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | span 32 | ==== 33 | 34 | A polyfill ("shim", fill-in-layer) meant to emulate `std::span `_. 35 | 36 | Available in the namespace uner the name ``ztd::span``. 37 | -------------------------------------------------------------------------------- /documentation/source/api/tag.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | tag 32 | === 33 | 34 | .. doxygenclass:: ztd::tag 35 | -------------------------------------------------------------------------------- /documentation/source/api/tag_invoke.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | tag_invoke 32 | ========== 33 | 34 | ``tag_invoke`` is a way of doing customization points in Modern C++ that is meant to be easier to work with and less hassle for end-users. It follows the paper `P1895 `_. A presentation for ``tag_invoke`` that covers its uses and its improvements over the status quo by `Gašper Ažman can be found here `_. 35 | 36 | 37 | .. doxygenvariable:: ztd::tag_invoke 38 | 39 | 40 | .. doxygenclass:: ztd::is_tag_invocable 41 | 42 | 43 | .. doxygenvariable:: ztd::is_tag_invocable_v 44 | 45 | 46 | .. doxygenclass:: ztd::is_nothrow_tag_invocable 47 | 48 | 49 | .. doxygenvariable:: ztd::is_nothrow_tag_invocable_v 50 | 51 | 52 | .. doxygentypedef:: ztd::tag_invoke_result 53 | 54 | 55 | .. doxygentypedef:: ztd::tag_invoke_result_t 56 | -------------------------------------------------------------------------------- /documentation/source/api/to_address.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | to_address 32 | ========== 33 | 34 | Utility extension point to get the address of either a pointer (which is already an address) or an iterator type (which must be a contiguous iterator). 35 | 36 | .. note:: This does not actually check if the iterator is contiguous. It just checks if the input type is either a pointer or something which can be ``operator->()``, which implies it must yield an in-language pointer type eventually. 37 | 38 | .. doxygenclass:: ztd::is_operator_arrowable 39 | 40 | .. doxygenvariable:: ztd::is_operator_arrowable_v 41 | 42 | .. doxygenclass:: ztd::is_to_addressable 43 | 44 | .. doxygenvariable:: ztd::is_to_addressable_v 45 | 46 | .. doxygenvariable:: ztd::to_address 47 | -------------------------------------------------------------------------------- /documentation/source/api/type_traits/detection.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | detection 32 | ========= 33 | 34 | The "detection idiom" is a means to provide "detectors" (code from a ``using`` type definition whose definition has an expression wrapped in ``decltype(...)``) that can tell if a given expression compiles. 35 | 36 | 37 | .. doxygenclass:: ztd::detector 38 | :members: 39 | 40 | .. doxygenclass:: ztd::nonesuch 41 | 42 | .. doxygentypedef:: ztd::is_detected 43 | 44 | .. doxygenvariable:: ztd::is_detected_v 45 | 46 | .. doxygentypedef:: ztd::detected_t 47 | 48 | .. doxygentypedef:: ztd::detected_or 49 | -------------------------------------------------------------------------------- /documentation/source/api/type_traits/is_character.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | is_character 32 | ============ 33 | 34 | The ``is_character`` detects the typical "``char``" types in C++ (``char``, ``signed char``, ``char8_t``, ``char16_t``, and ``char32_t``). 35 | 36 | 37 | .. doxygenclass:: ztd::is_character 38 | 39 | .. doxygenvariable:: ztd::is_character_v 40 | -------------------------------------------------------------------------------- /documentation/source/api/type_traits/type_identity.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | type_identity 32 | ============= 33 | 34 | The ``type_identity`` and related ``type_identity_t`` are useful in controlling function template declarations where the arguments need to have their types prevent from being mutated or changed in undesirable ways. Otherwise, it does exactly what it says on the tin: launders the given type parameter into the ``::type`` aspect. 35 | 36 | 37 | .. doxygenclass:: ztd::type_identity 38 | 39 | .. doxygentypedef:: ztd::type_identity_t 40 | -------------------------------------------------------------------------------- /documentation/source/api/uninit.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | uninit 32 | ====== 33 | 34 | The ``ztd::uninit`` type is for holding a type that may be initialized by-default into an uninitialized state (e.g., for C-style arrays that are a member of a class). 35 | 36 | .. doxygenclass:: ztd::uninit 37 | :members: 38 | -------------------------------------------------------------------------------- /documentation/source/api/unwrap.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | unwrap / unwrap_iterator_value 32 | ======================== 33 | 34 | Utility extension points to transform a potentially wrapped value (like :doc:`ztd::uninit `) so that the "real" value an be used. Often used in the guts of generic code rather than anywhere truly important, but a useful little utility nonetheless. 35 | 36 | .. doxygenvariable:: ztd::unwrap_iterator_value 37 | 38 | .. doxygenvariable:: ztd::unwrap_iterator 39 | 40 | .. doxygenvariable:: ztd::unwrap 41 | -------------------------------------------------------------------------------- /documentation/source/benchmarks.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Benchmarks 32 | ========== 33 | 34 | As benchmarks are crafted, they will be added to this repository for the relevant materials! Benchmarks are meant to explore various scenarios, and typical are used to improve the quality of code in various places where it can matter most or prove a point to those who are curious. 35 | 36 | Unless it is relevant to the benchmark, we program in the most efficient way for the given benchmark for the given tools. For example 37 | 38 | Browse the categories of benchmarks: 39 | 40 | .. toctree:: 41 | :maxdepth: 1 42 | :glob: 43 | 44 | benchmarks/* 45 | -------------------------------------------------------------------------------- /documentation/source/bibliography.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Bibliography 32 | ============ 33 | 34 | These are all the resources that this documentation links to, in alphabetical order. 35 | 36 | 37 | .. glossary:: 38 | :sorted: 39 | 40 | ☜(゚ヮ゚☜) 41 | 'Eeey nothin' yet, boss! 42 | -------------------------------------------------------------------------------- /documentation/source/c_api/alignment.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Alignment 32 | ========= 33 | 34 | These APIs aid in aligning pointers and types. They are typically available for both C and C++. 35 | 36 | .. doxygendefine:: ZTD_ASSUME_ALIGNED 37 | -------------------------------------------------------------------------------- /documentation/source/c_api/bit.memreverse.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | 8-bit Memory Reverse 32 | ==================== 33 | 34 | The 8-bit memory reverse swaps 8-bit bytes, regardless of the size of ``CHAR_BIT`` on the given platform. In order to achieve this in a platform-agnostic manner, it requires that ``CHAR_BIT % 8`` is ``0``. When ``CHAR_BIT`` is larger than 8 (16, 24, 32, 64, and other values that are multiples of 8), each 8-bit byte within an ``unsigned char`` is masked off with ``0xFF << (8 * byte_index)``, and then serialized for storing/loading. ``byte_index`` is a value from [0, ``CHAR_BIT / 8``) and it is swapped with the reverse 8-bit byte, which is computed with ``0xFF << (8 * ((CHAR_BIT / 8) - 1 - byte_index))``. 35 | 36 | 37 | .. doxygenfunction:: ztdc_memreverse8 38 | 39 | .. doxygenfunction:: ztdc_memreverse8uN 40 | -------------------------------------------------------------------------------- /documentation/source/c_api/charN_t.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | char(8/16/32)_t 32 | =============== 33 | 34 | This makes ``char(8/16/32)_t`` available under the type definitions of ``ztd_char(8/16/32)_t``. This allows their use uniformly in C and C++, regardless of whether or not the type definition is present in the proper place. 35 | 36 | .. doxygentypedef:: ztd_char8_t 37 | 38 | .. doxygentypedef:: ztd_char16_t 39 | 40 | .. doxygentypedef:: ztd_char32_t 41 | -------------------------------------------------------------------------------- /documentation/source/c_api/endian.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | endian 32 | ====== 33 | 34 | The endian enumeration is a very simple enum used to communicate what kind of byte ordering certain parts of the library should use to interpret incoming byte sequences. The C version uses macros and can be found :doc:`here `. 35 | 36 | .. doxygendefine:: ZTDC_LITTLE_ENDIAN 37 | 38 | .. doxygendefine:: ZTDC_BIG_ENDIAN 39 | 40 | .. doxygendefine:: ZTDC_NATIVE_ENDIAN 41 | -------------------------------------------------------------------------------- /documentation/source/c_api/extent.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Extent 32 | ====== 33 | 34 | These utilities are for handling extents (arrays and pointers) in C and C++. 35 | 36 | .. doxygendefine:: ZTD_PTR_EXTENT 37 | -------------------------------------------------------------------------------- /documentation/source/config.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | 🔨 Configuring the Library 32 | ========================== 33 | 34 | .. _config-ZTD_DEBUG: 35 | 36 | - ``ZTD_DEBUG``: 37 | - Signals to ztd.idk and downstream users that this should be considered a "debugging" build. 38 | - Affects many things, such as error printouts, warnings given, and more. 39 | - Turned on by default if compiler/platform-specific debug macros are detected, or ``NDEBUG`` is not defined by the compiler/library. 40 | 41 | .. warning:: 42 | 43 | |unfinished_warning| 44 | -------------------------------------------------------------------------------- /documentation/source/definitions.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Glossary of Terms & Definitions 32 | =============================== 33 | 34 | Occasionally, we may need to use precise language to describe what we want. This contains a list of definitions that can be linked to from the documentation to help describe key concepts that are useful for the explication of the concepts and ideas found in this documentation. 35 | 36 | .. glossary:: 37 | :sorted: 38 | 39 | ¯\\_(ツ)_/¯ 40 | So far? There's none. 41 | -------------------------------------------------------------------------------- /documentation/source/future.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Progress & Future Work 32 | ====================== 33 | 34 | This is where the status and progress of the library will be kept. You can also check the `Issue Tracker `_ for specific issues and things being worked on! 35 | 36 | 37 | 38 | Containers 39 | ---------- 40 | 41 | We should work on some spicy containers. Probably. 42 | 43 | - ☐ ``fixed_vector`` (``noexcept``-throughout) 44 | - ☐ ``small_vector`` (``noexcept``-throughout) 45 | - ☐ ``vector`` (``noexcept``-throughout) 46 | 47 | 48 | Allocators 49 | ---------- 50 | 51 | We should release some spicy allocators. Maybe wrap a few of the existing ones. 52 | 53 | - ☐ That shiny new Linux allocator everyone was talking about early in the Pandemic 54 | - ☐ ``mimalloc`` (eww) 55 | - ☐ ``jemalloc`` (requires fixing their godawful build system) 56 | -------------------------------------------------------------------------------- /documentation/source/genindex.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Index 32 | ===== 33 | -------------------------------------------------------------------------------- /documentation/source/images/benchmarks/bit/count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soasis/idk/d5a93843a0c7f8b4bf73a1f888c4d6ccde9255ec/documentation/source/images/benchmarks/bit/count.png -------------------------------------------------------------------------------- /documentation/source/images/benchmarks/bit/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soasis/idk/d5a93843a0c7f8b4bf73a1f888c4d6ccde9255ec/documentation/source/images/benchmarks/bit/find.png -------------------------------------------------------------------------------- /documentation/source/images/benchmarks/bit/is_sorted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soasis/idk/d5a93843a0c7f8b4bf73a1f888c4d6ccde9255ec/documentation/source/images/benchmarks/bit/is_sorted.png -------------------------------------------------------------------------------- /documentation/source/images/benchmarks/bit/is_sorted_until.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soasis/idk/d5a93843a0c7f8b4bf73a1f888c4d6ccde9255ec/documentation/source/images/benchmarks/bit/is_sorted_until.png -------------------------------------------------------------------------------- /documentation/source/in the wild.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Users in the Wild 32 | ================= 33 | 34 | 35 | I mean. ... Should you really be using this directly...? 36 | -------------------------------------------------------------------------------- /documentation/source/license.rst: -------------------------------------------------------------------------------- 1 | .. ============================================================================= 2 | .. 3 | .. ztd.idk 4 | .. Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | .. Contact: opensource@soasis.org 6 | .. 7 | .. Commercial License Usage 8 | .. Licensees holding valid commercial ztd.idk licenses may use this file in 9 | .. accordance with the commercial license agreement provided with the 10 | .. Software or, alternatively, in accordance with the terms contained in 11 | .. a written agreement between you and Shepherd's Oasis, LLC. 12 | .. For licensing terms and conditions see your agreement. For 13 | .. further information contact opensource@soasis.org. 14 | .. 15 | .. Apache License Version 2 Usage 16 | .. Alternatively, this file may be used under the terms of Apache License 17 | .. Version 2.0 (the "License") for non-commercial use; you may not use this 18 | .. file except in compliance with the License. You may obtain a copy of the 19 | .. License at 20 | .. 21 | .. https://www.apache.org/licenses/LICENSE-2.0 22 | .. 23 | .. Unless required by applicable law or agreed to in writing, software 24 | .. distributed under the License is distributed on an "AS IS" BASIS, 25 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | .. See the License for the specific language governing permissions and 27 | .. limitations under the License. 28 | .. 29 | .. =============================================================================> 30 | 31 | Licenses, Thanks and Attribution 32 | ================================= 33 | 34 | 35 | ``ztd.idk`` is dual-licensed under either the Apache 2 License, or a corporate license if you bought it with special support. See the LICENSE file or your copy of the corporate license agreement for more details! 36 | 37 | 38 | Heartfelt Thanks 39 | ---------------- 40 | 41 | Thank you to the `Macromancer, Jordan Rose `_, for suggesting the expansion of "idk" as the "Industrial Development Kit" and Ólafur Waage for deeply encouraging "idk" as the acronym. It's a brilliant name! 42 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soasis/idk/d5a93843a0c7f8b4bf73a1f888c4d6ccde9255ec/examples/CMakeLists.txt -------------------------------------------------------------------------------- /include/ztd/epilogue.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | // clang-format off 34 | 35 | #if !defined(ZTD_PROLOGUE_I_) 36 | #error "[ztd] Library Prologue is missing from this translation unit." 37 | #else 38 | #undef ZTD_PROLOGUE_I_ 39 | #endif 40 | 41 | #if ZTD_IS_ON(ZTD_CXX) 42 | #undef _FWD 43 | #undef _MOVE 44 | #endif 45 | 46 | // clang-format on 47 | -------------------------------------------------------------------------------- /include/ztd/idk.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_H 34 | #define ZTD_IDK_H 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/ztd/idk/assume_aligned.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_ASSUME_ALIGNED_HPP 34 | #define ZTD_IDK_ASSUME_ALIGNED_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/ztd/idk/auto.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_AUTO_H 34 | #define ZTD_IDK_AUTO_H 35 | 36 | #include 37 | 38 | // clang-format off 39 | #if ZTD_IS_ON(ZTD_CXX) 40 | 41 | #define zauto auto 42 | 43 | #else 44 | 45 | #if ZTD_IS_ON(ZTD_AUTO_TYPE) 46 | #define ztd_auto __auto_type 47 | #elif __STDC_VERSION__ > 202300L 48 | #define ztd_auto auto 49 | #else 50 | // Just guess for this one, I suppose? 51 | #define ztd_auto __auto_type 52 | #endif 53 | 54 | #endif 55 | // clang-format off 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/ztd/idk/contiguous_iterator_tag.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_CONTIGUOUS_ITERATOR_TAG_HPP 34 | #define ZTD_IDK_CONTIGUOUS_ITERATOR_TAG_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | #include 41 | 42 | namespace ztd { 43 | ZTD_IDK_INLINE_ABI_NAMESPACE_OPEN_I_ 44 | 45 | namespace __idk_detail { 46 | class __contiguous_iterator_tag : public ::std::random_access_iterator_tag { }; 47 | } // namespace __idk_detail 48 | 49 | ////// 50 | /// @brief Either a typedef or a polyfill of the contiguous iterator tag, only standardized in C++20. 51 | /// 52 | using contiguous_iterator_tag = 53 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_CONTIGUOUS_ITERATOR_TAG) 54 | ::std::contiguous_iterator_tag 55 | #else 56 | __idk_detail::__contiguous_iterator_tag 57 | #endif 58 | ; 59 | 60 | ZTD_IDK_INLINE_ABI_NAMESPACE_CLOSE_I_ 61 | } // namespace ztd 62 | 63 | #include 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /include/ztd/idk/declval.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_DECLVAL_H 34 | #define ZTD_IDK_DECLVAL_H 35 | 36 | #include 37 | 38 | #include 39 | 40 | #if ZTD_IS_ON(ZTD_CXX) 41 | #include 42 | 43 | #define ZTDC_DECLVAL(...) ::std::declval<__VA_ARGS__>() 44 | #else 45 | #define ZTDC_DECLVAL(...) (*((ztd_typeof(__VA_ARGS__)*)0)) 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/ztd/idk/detail/doxygen_type.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_DETAIL_DOXYGEN_TYPE_H 34 | #define ZTD_IDK_DETAIL_DOXYGEN_TYPE_H 35 | 36 | #include 37 | 38 | ////// 39 | /// @addtogroup ztd_idk_c_c_span ztd.idk c_span 40 | /// 41 | /// @{ 42 | ////// 43 | 44 | #if ZTD_IS_ON(ZTD_DOXYGEN_PREPROCESSING) 45 | ////// 46 | /// @brief A type that represents generic code. 47 | ////// 48 | typedef unsigned char ztd_generic_type; 49 | #endif 50 | 51 | ////// 52 | /// @} 53 | ////// 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/ztd/idk/detail/math.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_DETAIL_MATH_HPP 34 | #define ZTD_IDK_DETAIL_MATH_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | #include 41 | 42 | namespace ztd { 43 | ZTD_IDK_INLINE_ABI_NAMESPACE_OPEN_I_ 44 | namespace __idk_detail { 45 | 46 | constexpr uint_least64_t __ce_ipow_r(uint_least64_t base, uint_least64_t exp, uint_least64_t result) { 47 | return exp < 1u ? result : __ce_ipow_r(base * base, exp / 2, (exp % 2) ? result * base : result); 48 | } 49 | 50 | constexpr uint_least64_t __ce_ipow(uint_least64_t base, uint_least64_t exp) { 51 | return __ce_ipow_r(base, exp, 1); 52 | } 53 | 54 | } // namespace __idk_detail 55 | ZTD_IDK_INLINE_ABI_NAMESPACE_CLOSE_I_ 56 | } // namespace ztd 57 | 58 | #include 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /include/ztd/idk/detail/unicode.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_DETAIL_UNICODE_HPP 34 | #define ZTD_IDK_DETAIL_UNICODE_HPP 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | 41 | #include 42 | 43 | namespace ztd { 44 | ZTD_IDK_INLINE_ABI_NAMESPACE_OPEN_I_ 45 | namespace __idk_detail { 46 | template 47 | inline constexpr int __utf8_decode_length(ztd_char32_t __value) noexcept { 48 | if constexpr (_IsOverlong) { 49 | return __ztd_idk_detail_utf8_decode_length_overlong(__value); 50 | } 51 | else { 52 | return __ztd_idk_detail_utf8_decode_length(__value); 53 | } 54 | } 55 | } // namespace __idk_detail 56 | ZTD_IDK_INLINE_ABI_NAMESPACE_CLOSE_I_ 57 | } // namespace ztd 58 | 59 | #include 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/ztd/idk/detail/windows.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_DETAIL_WINDOWS_H 34 | #define ZTD_IDK_DETAIL_WINDOWS_H 35 | 36 | #include 37 | 38 | #include 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/ztd/idk/explicit.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_EXPLICIT_HPP 34 | #define ZTD_IDK_EXPLICIT_HPP 35 | 36 | #include 37 | 38 | ////// 39 | /// @addtogroup ztd_idk_explicit Explicit Utilities 40 | /// 41 | /// @{ 42 | ////// 43 | 44 | #if ZTD_IS_ON(ZTD_STD_EXPLICIT) 45 | ////// 46 | /// @brief Either compiles to explicit(bool) or simply compiles to nothing depending on if the feature is available. 47 | /// 48 | /// @param[in] ... An expression which computes a boolean value. 49 | #define ZTD_EXPLICIT(...) explicit(__VA_ARGS__) 50 | #else 51 | ////// 52 | /// @brief Either compiles to explicit(bool) or simply compiles to nothing depending on if the feature is available. 53 | /// 54 | /// @param[in] ... An expression which computes a boolean value. 55 | #define ZTD_EXPLICIT(...) /* nothing */ 56 | #endif 57 | ////// 58 | /// @} 59 | ////// 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/ztd/idk/extent.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_EXTENT_H 34 | #define ZTD_IDK_EXTENT_H 35 | 36 | #include 37 | 38 | ////// 39 | /// @addtogroup ztd_idk_extent Extent Utilities 40 | /// 41 | /// @{ 42 | ////// 43 | 44 | ////// 45 | /// @brief Provides the `T arg[static N]` functionality ("sized at least `N` large" hint). 46 | /// 47 | /// @param[in] ... An expression which computes the intended size of the pointer argument. 48 | /// 49 | /// @remarks Expands to the proper notation for C compilers, and expands to nothing for C++ compilers. It is meant to be 50 | /// used as in the declaration: `void f(T arg[ZTD_PTR_EXTENT(N)]);`. 51 | #define ZTD_PTR_EXTENT(...) ZTD_STATIC_PTR_EXTENT_I_(__VA_ARGS__) 52 | 53 | ////// 54 | /// @} 55 | ////// 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/ztd/idk/generic.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_GENERIC_HPP 34 | #define ZTD_IDK_GENERIC_HPP 35 | 36 | #include 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/ztd/idk/mbstate_t.h: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.cuneicode licenses may use this file 9 | // in accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License"); you may not use this file except in compliance 18 | // with the License. You may obtain a copy of the License at 19 | // 20 | // https://www.apache.org/licenses/LICENSE-2.0 21 | // 22 | // Unless required by applicable law or agreed to in writing, software 23 | // distributed under the License is distributed on an "AS IS" BASIS, 24 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | // See the License for the specific language governing permissions and 26 | // limitations under the License. 27 | // 28 | // ========================================================================= // 29 | 30 | #ifndef ZTD_IDK_MBSTATE_H 31 | #define ZTD_IDK_MBSTATE_H 32 | 33 | #pragma once 34 | 35 | #include 36 | 37 | #if ZTD_IS_ON(ZTD_HEADER_CWCHAR) 38 | #include 39 | #elif ZTD_IS_ON(ZTD_HEADER_WCHAR_H) 40 | #include 41 | #endif 42 | #if ZTD_IS_ON(ZTD_HEADER_CUCHAR) 43 | #include 44 | #elif ZTD_IS_ON(ZTD_HEADER_UCHAR_H) 45 | ZTD_EXTERN_C_OPEN_I_ 46 | #include 47 | ZTD_EXTERN_C_CLOSE_I_ 48 | #endif 49 | 50 | typedef ZTD_MBSTATE_SCOPE_I_ mbstate_t ztd_mbstate_t; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/ztd/idk/mbstate_t.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.cuneicode licenses may use this file 9 | // in accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License"); you may not use this file except in compliance 18 | // with the License. You may obtain a copy of the License at 19 | // 20 | // https://www.apache.org/licenses/LICENSE-2.0 21 | // 22 | // Unless required by applicable law or agreed to in writing, software 23 | // distributed under the License is distributed on an "AS IS" BASIS, 24 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 25 | // See the License for the specific language governing permissions and 26 | // limitations under the License. 27 | // 28 | // ========================================================================= // 29 | 30 | #ifndef ZTD_IDK_MBSTATE_HPP 31 | #define ZTD_IDK_MBSTATE_HPP 32 | 33 | #pragma once 34 | 35 | #include 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/ztd/idk/null.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_NULL_H 34 | #define ZTD_IDK_NULL_H 35 | 36 | #include 37 | 38 | #include 39 | 40 | #define ztd_null_of(...) ((ztd_typeof(__VA_ARGS__)*)0) 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/ztd/idk/restrict.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #include 34 | 35 | #ifndef ZTD_IDK_RESTRICT_H 36 | #define ZTD_IDK_RESTRICT_H 37 | 38 | #if ZTD_IS_ON(ZTD_CXX) && !defined(restrict) 39 | #define restrict 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/ztd/idk/size.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_SIZE_HPP 34 | #define ZTD_IDK_SIZE_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | namespace ztd { 41 | ZTD_IDK_INLINE_ABI_NAMESPACE_OPEN_I_ 42 | 43 | template 44 | constexpr size_t c_string_ptr_size(_Type* __ptr, const _Sentinel& __sen) noexcept { 45 | if (__ptr == nullptr) { 46 | return 0; 47 | } 48 | size_t __len = 0; 49 | while (__ptr[__len] != __sen) { 50 | ++__len; 51 | } 52 | return __len; 53 | } 54 | 55 | template 56 | constexpr size_t c_string_ptr_size(_Type* __ptr) noexcept { 57 | constexpr _Type __sentinel {}; 58 | return c_string_ptr_size(__ptr, __sentinel); 59 | } 60 | 61 | ZTD_IDK_INLINE_ABI_NAMESPACE_CLOSE_I_ 62 | } // namespace ztd 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/ztd/idk/statement_expressions.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_STATEMENT_EXPRESSIONS_H 34 | #define ZTD_IDK_STATEMENT_EXPRESSIONS_H 35 | 36 | #include 37 | 38 | // clang-format off 39 | #if ZTD_IS_ON(ZTD_CXX) 40 | #define ZTD_STMT_EXPR_BEGIN() ([&]() { 41 | #define ZTD_STMT_EXPR_END() }()) 42 | #define ZTD_STMT_EXPR_RETURN(...) return __VA_ARGS__ 43 | #define ZTD_STMT_EXPR_USABLE_I_ ZTD_ON 44 | #elif ZTD_IS_ON(ZTD_STATEMENT_EXPRESSIONS) 45 | #define ZTD_STMT_EXPR_BEGIN() ({ 46 | #define ZTD_STMT_EXPR_END() }) 47 | #define ZTD_STMT_EXPR_RETURN(...) __VA_ARGS__ 48 | #define ZTD_STMT_EXPR_USABLE_I_ ZTD_ON 49 | #else 50 | #define ZTD_STMT_EXPR_BEGIN() 51 | #define ZTD_STMT_EXPR_END() 52 | #define ZTD_STMT_EXPR_RETURN(...) __VA_ARGS__ 53 | #define ZTD_STMT_EXPR_USABLE_I_ ZTD_OFF 54 | #endif 55 | // clang-format on 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/ztd/idk/statement_expressions.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_STATEMENT_EXPRESSIONS_HPP 34 | #define ZTD_IDK_STATEMENT_EXPRESSIONS_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/ztd/idk/static_assert.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_STATIC_ASSERT_H 34 | #define ZTD_IDK_STATIC_ASSERT_H 35 | 36 | #include 37 | 38 | #if ZTD_IS_ON(ZTD_CXX) 39 | #define ztdc_static_assert(...) static_assert(__VA_ARGS__) 40 | #else 41 | #if ZTD_IS_ON(ZTD_COMPILER_VCXX) 42 | #include 43 | #define ztdc_static_assert(...) static_assert(__VA_ARGS__) 44 | #else 45 | #define ztdc_static_assert(...) _Static_assert(__VA_ARGS__) 46 | #endif 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/ztd/idk/static_assert.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_STATIC_ASSERT_HPP 34 | #define ZTD_STATIC_ASSERT_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/ztd/idk/tag.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_TAG_HPP 34 | #define ZTD_IDK_TAG_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | ////// 41 | /// @addtogroup ztd_idk_tags Tags 42 | /// @{ 43 | ////// 44 | 45 | namespace ztd { 46 | 47 | ////// 48 | /// @brief A tag type which can hold arbitrarily many types. Useful as an anchor for overload resolution on 49 | /// specific entities, extension point anchors, and more. Not related to the ztd::tag_invoke infrastructure. 50 | template 51 | class tag { }; 52 | 53 | } // namespace ztd 54 | 55 | /// @} 56 | ////// 57 | 58 | 59 | #include 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/ztd/idk/thread_local.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_STATIC_ASSERT_H 34 | #define ZTD_STATIC_ASSERT_H 35 | 36 | #include 37 | 38 | #if ZTD_IS_ON(ZTD_CXX) 39 | #define ztd_thread_local thread_local 40 | #else 41 | #if __STDC_VERSION__ >= 202311L 42 | #define ztd_thread_local thread_local 43 | #else 44 | #define ztd_thread_local _Thread_local 45 | #endif 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/ztd/idk/typeof.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_TYPEOF_H 34 | #define ZTD_IDK_TYPEOF_H 35 | 36 | #include 37 | 38 | #if ZTD_IS_ON(ZTD_CXX) 39 | #include 40 | 41 | #define ztd_typeof(...) ::std::remove_reference_t 42 | #elif ZTD_IS_OFF(ZTD_COMPILER_VCXX) 43 | #define ztd_typeof(...) __typeof__(__VA_ARGS__) 44 | #elif ZTD_IS_ON(ZTD_C) && (__STDC_VERSION__ > 202300L) 45 | #define ztd_typeof(...) typeof(__VA_ARGS__) 46 | #else 47 | #define ztd_typeof(...) typeof(__VA_ARGS__) 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/ztd/idk/unreachable.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_UNREACHABLE_H 34 | #define ZTD_IDK_UNREACHABLE_H 35 | 36 | #include 37 | 38 | #if ZTD_HAS_BUILTIN_I_(__builtin_unreachable) 39 | #define ZTD_UNREACHABLE() __builtin_unreachable(); 40 | #elif ZTD_IS_ON(ZTD_COMPILER_VCXX) 41 | #define ZTD_UNREACHABLE() __assume(false); 42 | #else 43 | #define ZTD_UNREACHABLE() __builtin_unreachable(); 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/ztd/idk/unreachable.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_UNREACHABLE_HPP 34 | #define ZTD_IDK_UNREACHABLE_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | // Nothing to do here, yet, since there's no C++-specific tech for unreachable that is needed. 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/ztd/idk/utf8_locale.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_UTF8_LOCALE_H 34 | #define ZTD_IDK_UTF8_LOCALE_H 35 | 36 | #include 37 | 38 | #if ZTD_IS_ON(ZTD_C) 39 | #include 40 | #endif 41 | 42 | ZTD_USE(ZTD_C_LANGUAGE_LINKAGE) ZTD_USE(ZTD_IDK_API_LINKAGE) bool ztd_idk_attempt_utf8_locale(void); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/ztd/idk/utf8_startup_hook.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_UTF8_STARTUP_HOOK_HPP 34 | #define ZTD_IDK_UTF8_STARTUP_HOOK_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | #include 41 | 42 | namespace ztd { 43 | ////// 44 | /// @brief A hook which attempts to set the locale to a UTF-8 locale of some kind. 45 | struct utf8_startup_hook { 46 | ////// 47 | /// @brief The result of the hook. 48 | int result; 49 | 50 | ////// 51 | /// @brief A constructor which attempts to set the locale to UTF-8. 52 | utf8_startup_hook() noexcept : result(0) { 53 | result = ztd_idk_attempt_utf8_locale(); 54 | if (result == 0) { 55 | std::cerr << "cannot set the locale-based encoding in non-Windows to UTF8" << std::endl; 56 | } 57 | } 58 | }; 59 | } // namespace ztd 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /include/ztd/idk/version.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_VERSION_H 34 | #define ZTD_IDK_VERSION_H 35 | 36 | #include 37 | 38 | #define ZTD_IDK_VERSION_MAJOR 1 39 | #define ZTD_IDK_VERSION_MINOR 0 40 | #define ZTD_IDK_VERSION_PATCH 0 41 | #define ZTD_IDK_VERSION_STRING ZTD_MAKE_VERSION_STR(ZTD_IDK_VERSION_MAJOR, ZTD_IDK_VERSION_MINOR, ZTD_IDK_VERSION_PATCH) 42 | #define ZTD_IDK_VERSION ZTD_MAKE_VERSION_INT(ZTD_IDK_VERSION_MAJOR, ZTD_IDK_VERSION_MINOR, ZTD_IDK_VERSION_PATCH) 43 | 44 | #include 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/ztd/idk/version.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_VERSION_HPP 34 | #define ZTD_IDK_VERSION_HPP 35 | 36 | #include 37 | #include 38 | 39 | // clang-format off 40 | 41 | #if defined(ZTD_IDK_ABI_NAMESPACE) 42 | #define ZTD_IDK_INLINE_ABI_NAMESPACE_OPEN_I_ inline namespace ZTD_IDK_ABI_NAMESPACE { 43 | #define ZTD_IDK_INLINE_ABI_NAMESPACE_CLOSE_I_ } 44 | #else 45 | #define ZTD_IDK_INLINE_ABI_NAMESPACE_OPEN_I_ inline namespace __v0 { 46 | #define ZTD_IDK_INLINE_ABI_NAMESPACE_CLOSE_I_ } 47 | #endif 48 | 49 | // clang-format on 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/ztd/prologue.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | // clang-format off 34 | 35 | #if defined(ZTD_PROLOGUE_I_) 36 | #error "[ztd] Library Prologue was already included in translation unit and not properly ended with an epilogue." 37 | #endif 38 | 39 | #define ZTD_PROLOGUE_I_ 1 40 | 41 | #if ZTD_IS_ON(ZTD_CXX) 42 | 43 | #define _FWD(...) static_cast( __VA_ARGS__ ) 44 | 45 | #if ZTD_IS_ON(ZTD_COMPILER_GCC) || ZTD_IS_ON(ZTD_COMPILER_CLANG) 46 | #define _MOVE(...) static_cast<__typeof( __VA_ARGS__ )&&>( __VA_ARGS__ ) 47 | #else 48 | #include 49 | 50 | #define _MOVE(...) static_cast<::std::remove_reference_t<( __VA_ARGS__ )>&&>( __VA_OPT__(,) ) 51 | #endif 52 | #endif 53 | 54 | // clang-format on 55 | -------------------------------------------------------------------------------- /include/ztd/ranges/default_sentinel.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_RANGES_DEFAULT_SENTINEL_HPP 34 | #define ZTD_RANGES_DEFAULT_SENTINEL_HPP 35 | 36 | #include 37 | 38 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_RANGES) 39 | #include 40 | #endif 41 | 42 | #include 43 | 44 | namespace ztd { namespace ranges { 45 | ZTD_RANGES_INLINE_ABI_NAMESPACE_OPEN_I_ 46 | 47 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_RANGES) 48 | ////// 49 | /// @brief A sentinel that cannot compare equal to any other iterator and thus results in infinitely long ranges. 50 | using default_sentinel_t = ::std::default_sentinel_t; 51 | #else 52 | ////// 53 | /// @brief A sentinel that cannot compare equal to any other iterator and thus results in infinitely long ranges. 54 | struct default_sentinel_t { }; 55 | #endif 56 | 57 | 58 | ////// 59 | /// @brief An available and usable ztd::ranges::default_sentinel for ease of use. 60 | inline constexpr default_sentinel_t default_sentinel = {}; 61 | 62 | ZTD_RANGES_INLINE_ABI_NAMESPACE_CLOSE_I_ 63 | }} // namespace ztd::ranges 64 | 65 | #include 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /include/ztd/ranges/from_range.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_RANGES_FROM_RANGE_HPP 34 | #define ZTD_RANGES_FROM_RANGE_HPP 35 | 36 | #include 37 | 38 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_FROM_RANGE_T) 39 | #include 40 | #endif 41 | 42 | #include 43 | 44 | namespace ztd { namespace ranges { 45 | ZTD_RANGES_INLINE_ABI_NAMESPACE_OPEN_I_ 46 | 47 | #if ZTD_IS_OFF(ZTD_STD_LIBRARY_FROM_RANGE_T) 48 | namespace __rng_detail { 49 | struct __from_range_t { }; 50 | } // namespace __rng_detail 51 | #endif 52 | 53 | 54 | using from_range_t = 55 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_FROM_RANGE_T) 56 | ::std::from_range_t 57 | #else 58 | __rng_detail::__from_range_t 59 | #endif 60 | ; 61 | 62 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_FROM_RANGE_T) 63 | inline constexpr const ::std::from_range_t& from_range = ::std::from_range; 64 | #else 65 | inline constexpr from_range_t from_range = {}; 66 | #endif 67 | 68 | ZTD_RANGES_INLINE_ABI_NAMESPACE_CLOSE_I_ 69 | }} // namespace ztd::ranges 70 | 71 | #include 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /include/ztd/ranges/repeat.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_RANGES_REPEAT_HPP 34 | #define ZTD_RANGES_REPEAT_HPP 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | 44 | #include 45 | #include 46 | 47 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_RANGES) 48 | #include 49 | #endif 50 | 51 | #include 52 | 53 | namespace ztd { namespace ranges { 54 | ZTD_RANGES_INLINE_ABI_NAMESPACE_OPEN_I_ 55 | 56 | ////// 57 | /// @addtogroup ztd_ranges_support Support Classes 58 | /// 59 | /// @{ 60 | 61 | ////// 62 | /// @} 63 | 64 | ZTD_RANGES_INLINE_ABI_NAMESPACE_CLOSE_I_ 65 | }} // namespace ztd::ranges 66 | 67 | #include 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/ztd/ranges/version.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_RANGES_VERSION_HPP 34 | #define ZTD_RANGES_VERSION_HPP 35 | 36 | #include 37 | 38 | #define ZTD_RANGES_VERSION_MAJOR 0 39 | #define ZTD_RANGES_VERSION_MINOR 0 40 | #define ZTD_RANGES_VERSION_PATCH 0 41 | #define ZTD_RANGES_VERSION_STRING "0.0.0" 42 | #define ZTD_RANGES_VERSION \ 43 | ((ZTD_RANGES_VERSION_MAJOR * 100'000) + (ZTD_RANGES_VERSION_MINOR * 100) + (ZTD_RANGES_VERSION_PATCH)) 44 | 45 | // clang-format off 46 | 47 | #if defined(ZTD_RANGES_ABI_NAMESPACE) 48 | #define ZTD_RANGES_INLINE_ABI_NAMESPACE_OPEN_I_ inline namespace ZTD_RANGES_ABI_NAMESPACE { 49 | #define ZTD_RANGES_INLINE_ABI_NAMESPACE_CLOSE_I_ } 50 | #else 51 | #define ZTD_RANGES_INLINE_ABI_NAMESPACE_OPEN_I_ inline namespace __v0 { 52 | #define ZTD_RANGES_INLINE_ABI_NAMESPACE_CLOSE_I_ } 53 | #endif 54 | 55 | // clang-format on 56 | 57 | #include 58 | 59 | #include 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/ztd/ranges/view.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_RANGES_VIEW_HPP 34 | #define ZTD_RANGES_VIEW_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | #if ZTD_IS_ON(ZTD_STD_LIBRARY_RANGES) 41 | #include 42 | #endif 43 | 44 | #include 45 | 46 | namespace ztd { namespace ranges { 47 | ZTD_RANGES_INLINE_ABI_NAMESPACE_OPEN_I_ 48 | 49 | 50 | ZTD_RANGES_INLINE_ABI_NAMESPACE_CLOSE_I_ 51 | }} // namespace ztd::ranges 52 | 53 | #include 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/ztd/tag_invoke.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_TAG_INVOKE_HPP 34 | #define ZTD_TAG_INVOKE_HPP 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/ztd/tag_invoke/tag_t.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_TAG_INVOKE_TAG_T_HPP 34 | #define ZTD_TAG_INVOKE_TAG_T_HPP 35 | 36 | #include 37 | 38 | #include 39 | 40 | namespace ztd { 41 | ZTD_TAG_INVOKE_INLINE_ABI_NAMESPACE_OPEN_I_ 42 | 43 | ////// 44 | /// @brief The tag_t alias produces the type of the given reconstruction point. It's used to directly hook into the 45 | /// tag_invoke infrastructure. 46 | template 47 | using tag_t = ::std::remove_cv_t<::std::remove_reference_t>; 48 | 49 | ZTD_TAG_INVOKE_INLINE_ABI_NAMESPACE_CLOSE_I_ 50 | } // namespace ztd 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/ztd/tag_invoke/version.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_TAG_INVOKE_VERSION_HPP 34 | #define ZTD_TAG_INVOKE_VERSION_HPP 35 | 36 | #define ZTD_TAG_INVOKE_VERSION_MAJOR 0 37 | #define ZTD_TAG_INVOKE_VERSION_MINOR 0 38 | #define ZTD_TAG_INVOKE_VERSION_PATCH 0 39 | #define ZTD_TAG_INVOKE_VERSION_STRING "0.0.0" 40 | #define ZTD_TAG_INVOKE_VERSION \ 41 | ((ZTD_TAG_INVOKE_VERSION_MAJOR * 100'000) + (ZTD_TAG_INVOKE_VERSION_MINOR * 100) + (ZTD_TAG_INVOKE_VERSION_PATCH)) 42 | 43 | // clang-format off 44 | 45 | #if defined(ZTD_TAG_INVOKE_ABI_NAMESPACE) 46 | #define ZTD_TAG_INVOKE_INLINE_ABI_NAMESPACE_OPEN_I_ inline namespace ZTD_TAG_INVOKE_ABI_NAMESPACE { 47 | #define ZTD_TAG_INVOKE_INLINE_ABI_NAMESPACE_CLOSE_I_ } 48 | #else 49 | #define ZTD_TAG_INVOKE_INLINE_ABI_NAMESPACE_OPEN_I_ inline namespace __v0 { 50 | #define ZTD_TAG_INVOKE_INLINE_ABI_NAMESPACE_CLOSE_I_ } 51 | #endif 52 | 53 | //clang-format on 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/ztd/tests/compare_each.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_IDK_TESTS_RESULT_COMPARE_HPP 34 | #define ZTD_IDK_TESTS_RESULT_COMPARE_HPP 35 | 36 | #include 37 | 38 | namespace ztd { namespace tests { 39 | 40 | template 41 | void compare_each(Result& result, Expected& expected) { 42 | std::size_t result_size = result.size(); 43 | std::size_t expected_size = expected.size(); 44 | for (std::size_t index = 0; index < expected_size; ++index) { 45 | REQUIRE(result_size > index); 46 | const auto& result_c = result[index]; 47 | const auto& expected_c = expected[index]; 48 | if (result_c != expected_c) { 49 | REQUIRE(result_c == expected_c); 50 | } 51 | REQUIRE(result_c == expected_c); 52 | } 53 | REQUIRE(result_size == expected_size); 54 | REQUIRE(result == expected); 55 | } 56 | 57 | }} // namespace ztd::tests 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/ztd/version.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_VERSION_H 34 | #define ZTD_VERSION_H 35 | 36 | #include 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/ztd/version.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_VERSION_HPP 34 | #define ZTD_VERSION_HPP 35 | 36 | #include 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/ztd/version/version.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_VERSION_VERSION_H 34 | #define ZTD_VERSION_VERSION_H 35 | 36 | #define ZTD_MAKE_VERSION_INT(_MAJOR_VER, _MINOR_VER, _PATCH_VER) \ 37 | ((_MAJOR_VER * 10000000ull) + (_MINOR_VER * 10000ull) + (_PATCH_VER * 1ull)) 38 | #define ZTD_MAKE_VERSION_STR(_MAJOR_VER, _MINOR_VER, _PATCH_VER) "" #_MAJOR_VER "." #_MINOR_VER "." #_PATCH_VER "" 39 | 40 | #define ZTD_VERSION_MAJOR 1 41 | #define ZTD_VERSION_MINOR 0 42 | #define ZTD_VERSION_PATCH 0 43 | #define ZTD_VERSION_STRING ZTD_MAKE_VERSION_STR(ZTD_VERSION_MAJOR, ZTD_VERSION_MINOR, ZTD_VERSION_PATCH) 44 | #define ZTD_VERSION_VERSION ZTD_MAKE_VERSION_INT(ZTD_VERSION_MAJOR, ZTD_VERSION_MINOR, ZTD_VERSION_PATCH) 45 | 46 | #include 47 | #include 48 | #include 49 | 50 | #include 51 | #include 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/ztd/version/version.hpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #pragma once 32 | 33 | #ifndef ZTD_VERSION_VERSION_HPP 34 | #define ZTD_VERSION_VERSION_HPP 35 | 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /single/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soasis/idk/d5a93843a0c7f8b4bf73a1f888c4d6ccde9255ec/single/CMakeLists.txt -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Fetch dependencies 32 | # Catch2 33 | FetchContent_Declare( 34 | catch2 35 | GIT_REPOSITORY https://github.com/catchorg/Catch2.git 36 | GIT_TAG devel 37 | EXCLUDE_FROM_ALL 38 | ) 39 | FetchContent_MakeAvailable(catch2) 40 | 41 | add_subdirectory(idk) 42 | add_subdirectory(tag_invoke) 43 | add_subdirectory(version) 44 | -------------------------------------------------------------------------------- /tests/idk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Test Subdirectories 32 | add_subdirectory(inclusion) 33 | add_subdirectory(basic_compile_time) 34 | add_subdirectory(basic_run_time_c++) 35 | add_subdirectory(basic_run_time_c) 36 | add_subdirectory(constexpr_inline_struggles) 37 | -------------------------------------------------------------------------------- /tests/idk/basic_compile_time/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Tests 32 | file(GLOB_RECURSE ztd.idk.tests.basic_compile_time.sources 33 | LIST_DIRECTORIES FALSE 34 | CONFIGURE_DEPENDS 35 | source/*.cpp source/*.c) 36 | 37 | add_executable(ztd.idk.tests.basic_compile_time ${ztd.idk.tests.basic_compile_time.sources}) 38 | target_compile_options(ztd.idk.tests.basic_compile_time 39 | PRIVATE 40 | ${--utf8-literal-encoding} 41 | ${--utf8-source-encoding} 42 | ${--disable-permissive} 43 | ${--warn-pedantic} 44 | ${--warn-default} 45 | ${--warn-extra} 46 | ${--warn-errors} 47 | ${--allow-gnu-zero-variadic-macro-arguments}) 48 | target_link_libraries(ztd.idk.tests.basic_compile_time 49 | PRIVATE 50 | ztd::idk 51 | Catch2::Catch2 52 | ${CMAKE_DL_LIBS} 53 | ) 54 | 55 | add_test(NAME ztd.idk.tests.basic_compile_time COMMAND ztd.idk.tests.basic_compile_time) 56 | -------------------------------------------------------------------------------- /tests/idk/basic_compile_time/source/main.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | int main(int, char*[]) { 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /tests/idk/basic_run_time_c++/source/main.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #define CATCH_CONFIG_RUNNER 32 | #include 33 | 34 | #include 35 | 36 | #include 37 | 38 | int main(int argc, char* argv[]) { 39 | std::cout << "=== Encoding Names ===" << std::endl; 40 | std::cout << "Literal Encoding: " << ztd::literal_encoding_name() << std::endl; 41 | std::cout << "Wide Literal Encoding: " << ztd::wide_literal_encoding_name() << std::endl; 42 | std::cout << "Execution Encoding: " << ztd::execution_encoding_name() << std::endl; 43 | std::cout << "Wide Execution Encoding: " << ztd::wide_execution_encoding_name() << std::endl; 44 | int result = Catch::Session().run(argc, argv); 45 | return result; 46 | } 47 | -------------------------------------------------------------------------------- /tests/idk/basic_run_time_c/source/bit.intrinsic.c: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include "c_test.h" 32 | 33 | #include 34 | 35 | extern int bit_intrinsic_tests(void) { 36 | BEGIN_TEST("bit intrisics"); 37 | END_TEST(); 38 | } 39 | -------------------------------------------------------------------------------- /tests/idk/basic_run_time_c/source/bit.rotate.c: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include "c_test.h" 32 | 33 | #include 34 | 35 | extern int bit_rotate_tests(void) { 36 | BEGIN_TEST("rotate"); 37 | TEST_CASE("left", "test for rotating left") { 38 | } 39 | END_TEST(); 40 | BEGIN_TEST("rotate"); 41 | TEST_CASE("right", "test for rotating right") { 42 | } 43 | END_TEST(); 44 | } 45 | -------------------------------------------------------------------------------- /tests/idk/basic_run_time_c/source/main.c: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | extern int c_span_tests(void); 34 | extern int bit_intrinsic_tests(void); 35 | extern int bit_rotate_tests(void); 36 | extern int bit_memreverse_tests(void); 37 | extern int encoding_name_tests(void); 38 | 39 | int main(int argc, char* argv[]) { 40 | (void)argc; 41 | (void)argv; 42 | int result = 0; 43 | result += c_span_tests(); 44 | result += encoding_name_tests(); 45 | result += bit_intrinsic_tests(); 46 | result += bit_rotate_tests(); 47 | result += bit_memreverse_tests(); 48 | if (result == 0) { 49 | fprintf(stdout, "\n\n===========================================\nAll assertions passed!"); 50 | fflush(stdout); 51 | } 52 | else { 53 | fprintf(stderr, "\n\n===========================================\n%d assertions failed.", result); 54 | fflush(stderr); 55 | } 56 | return result; 57 | } 58 | -------------------------------------------------------------------------------- /tests/idk/constexpr_inline_struggles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Tests 32 | file(GLOB_RECURSE ztd.idk.tests.constexpr_inline_struggles.sources 33 | LIST_DIRECTORIES FALSE 34 | CONFIGURE_DEPENDS 35 | source/*.c source/*.cpp 36 | ) 37 | add_executable(ztd.idk.tests.constexpr_inline_struggles ${ztd.idk.tests.constexpr_inline_struggles.sources}) 38 | target_compile_options(ztd.idk.tests.constexpr_inline_struggles 39 | PRIVATE 40 | ${--utf8-literal-encoding} 41 | ${--utf8-source-encoding} 42 | ${--disable-permissive} 43 | ${--warn-pedantic} 44 | ${--warn-default} 45 | ${--warn-extra} 46 | ${--warn-errors}) 47 | target_include_directories(ztd.idk.tests.constexpr_inline_struggles 48 | PRIVATE 49 | include/ 50 | ) 51 | target_link_libraries(ztd.idk.tests.constexpr_inline_struggles 52 | PRIVATE 53 | ztd::idk 54 | ${CMAKE_DL_LIBS} 55 | ) 56 | add_test(NAME ztd.idk.tests.constexpr_inline_struggles COMMAND ztd.idk.tests.constexpr_inline_struggles) 57 | -------------------------------------------------------------------------------- /tests/idk/constexpr_inline_struggles/include/uses_size.h: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #ifndef ZTD_IDK_TESTS_CONSTEXPR_INLINE_STRUGGLES_USES_SIZE_H 32 | #define ZTD_IDK_TESTS_CONSTEXPR_INLINE_STRUGGLES_USES_SIZE_H 33 | 34 | #include 35 | 36 | #if ZTD_IS_ON(ZTD_CXX) 37 | #include 38 | #else 39 | #include 40 | #endif 41 | 42 | ZTD_USE(ZTD_EXTERN_C_OPEN) 43 | 44 | extern const char* ztd_idk_tests_c_foo; 45 | extern const size_t ztd_idk_tests_c_foo_size; 46 | extern size_t ztd_idk_tests_use_size(const char* p); 47 | extern size_t ztd_idk_tests_use_size2(const char* p); 48 | extern size_t ztd_idk_tests_use_size_cpp(const char* p); 49 | 50 | ZTD_USE(ZTD_EXTERN_C_CLOSE) 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /tests/idk/constexpr_inline_struggles/source/c_foo.c: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | const char* ztd_idk_tests_c_foo = "foo!?#jdkgniofkwgeunwgjgwbuohi904h"; 34 | const size_t ztd_idk_tests_c_foo_size = 34; 35 | -------------------------------------------------------------------------------- /tests/idk/constexpr_inline_struggles/source/main.c: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | int main(int argc, char* argv[]) { 34 | (void)argc; 35 | (void)argv; 36 | const size_t expected = ztd_idk_tests_c_foo_size * 2; 37 | if (expected != ztd_idk_tests_use_size(ztd_idk_tests_c_foo)) { 38 | return 1; 39 | } 40 | if (0 != ztd_idk_tests_use_size2(ztd_idk_tests_c_foo)) { 41 | return 2; 42 | } 43 | if (expected != ztd_idk_tests_use_size_cpp(ztd_idk_tests_c_foo)) { 44 | return 3; 45 | } 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /tests/idk/constexpr_inline_struggles/source/uses_size.c: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | 37 | ZTD_USE(ZTD_EXTERN_C) size_t ztd_idk_tests_use_size(const char* p) { 38 | return ztdc_c_string_ptr_size_c(p) + ztdc_c_string_ptr_size_limit_c(256, p); 39 | } 40 | -------------------------------------------------------------------------------- /tests/idk/constexpr_inline_struggles/source/uses_size.cpp: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | 37 | ZTD_USE(ZTD_EXTERN_C) size_t ztd_idk_tests_use_size_cpp(const char* p) { 38 | return ztdc_c_string_ptr_size_c(p) + ztdc_c_string_ptr_size_limit_c(256, p); 39 | } 40 | -------------------------------------------------------------------------------- /tests/idk/constexpr_inline_struggles/source/uses_size_again.c: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // 3 | // ztd.idk 4 | // Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | // Contact: opensource@soasis.org 6 | // 7 | // Commercial License Usage 8 | // Licensees holding valid commercial ztd.idk licenses may use this file in 9 | // accordance with the commercial license agreement provided with the 10 | // Software or, alternatively, in accordance with the terms contained in 11 | // a written agreement between you and Shepherd's Oasis, LLC. 12 | // For licensing terms and conditions see your agreement. For 13 | // further information contact opensource@soasis.org. 14 | // 15 | // Apache License Version 2 Usage 16 | // Alternatively, this file may be used under the terms of Apache License 17 | // Version 2.0 (the "License") for non-commercial use; you may not use this 18 | // file except in compliance with the License. You may obtain a copy of the 19 | // License at 20 | // 21 | // https://www.apache.org/licenses/LICENSE-2.0 22 | // 23 | // Unless required by applicable law or agreed to in writing, software 24 | // distributed under the License is distributed on an "AS IS" BASIS, 25 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | // See the License for the specific language governing permissions and 27 | // limitations under the License. 28 | // 29 | // ============================================================================ // 30 | 31 | #include 32 | 33 | #include 34 | 35 | #include 36 | 37 | ZTD_USE(ZTD_EXTERN_C) size_t ztd_idk_tests_use_size2(const char* p) { 38 | return ztdc_c_string_ptr_size_c(p) - ztdc_c_string_ptr_size_limit_c(256, p); 39 | } 40 | -------------------------------------------------------------------------------- /tests/idk/inclusion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | include(GenerateInclusionTest) 32 | 33 | generate_inclusion_test(NAME "ztd.idk.tests.inclusion" 34 | BASE_DIRECTORY "../../../include" 35 | ROOTS "../../../include/ztd/idk" 36 | REGEX_EXCLUSIONS ".*\.g\.h" ".*\.g\.hpp" 37 | LINK_LIBRARIES ztd::idk 38 | ) 39 | -------------------------------------------------------------------------------- /tests/ranges/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Test Subdirectories 32 | add_subdirectory(inclusion) 33 | -------------------------------------------------------------------------------- /tests/ranges/inclusion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | include(GenerateInclusionTest) 32 | 33 | generate_inclusion_test(NAME "ztd.ranges.tests.inclusion" 34 | BASE_DIRECTORY "../../../include" 35 | ROOTS "../../../include/ztd/ranges" 36 | LINK_LIBRARIES ztd::ranges 37 | ) 38 | -------------------------------------------------------------------------------- /tests/shared/include/ztd/idk/tests/unused_declaration.h: -------------------------------------------------------------------------------- 1 | int completely_out_of_the_way_declaration; 2 | -------------------------------------------------------------------------------- /tests/tag_invoke/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Test Subdirectories 32 | add_subdirectory(inclusion) 33 | -------------------------------------------------------------------------------- /tests/tag_invoke/inclusion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | include(GenerateInclusionTest) 32 | 33 | generate_inclusion_test(NAME "ztd.tag_invoke.tests.inclusion" 34 | BASE_DIRECTORY "../../../include" 35 | ROOTS "../../../include/ztd/tag_invoke" 36 | LINK_LIBRARIES ztd::tag_invoke 37 | ) 38 | -------------------------------------------------------------------------------- /tests/version/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | # # Test Subdirectories 32 | add_subdirectory(inclusion) 33 | -------------------------------------------------------------------------------- /tests/version/inclusion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ============================================================================= 2 | # 3 | # ztd.idk 4 | # Copyright © JeanHeyd "ThePhD" Meneide and Shepherd's Oasis, LLC 5 | # Contact: opensource@soasis.org 6 | # 7 | # Commercial License Usage 8 | # Licensees holding valid commercial ztd.idk licenses may use this file in 9 | # accordance with the commercial license agreement provided with the 10 | # Software or, alternatively, in accordance with the terms contained in 11 | # a written agreement between you and Shepherd's Oasis, LLC. 12 | # For licensing terms and conditions see your agreement. For 13 | # further information contact opensource@soasis.org. 14 | # 15 | # Apache License Version 2 Usage 16 | # Alternatively, this file may be used under the terms of Apache License 17 | # Version 2.0 (the "License") for non-commercial use; you may not use this 18 | # file except in compliance with the License. You may obtain a copy of the 19 | # License at 20 | # 21 | # https://www.apache.org/licenses/LICENSE-2.0 22 | # 23 | # Unless required by applicable law or agreed to in writing, software 24 | # distributed under the License is distributed on an "AS IS" BASIS, 25 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 26 | # See the License for the specific language governing permissions and 27 | # limitations under the License. 28 | # 29 | # ============================================================================> 30 | 31 | include(GenerateInclusionTest) 32 | 33 | generate_inclusion_test(NAME "ztd.version.tests.inclusion" 34 | BASE_DIRECTORY "../../../include" 35 | ROOTS "../../../include/ztd/version" 36 | LINK_LIBRARIES ztd::version 37 | ) 38 | --------------------------------------------------------------------------------