Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
02207ae
add: unique_handle class skeleton and test file
DNKpp Dec 28, 2021
0ee506e
disable copy ctor and assign of unique_handle
DNKpp Dec 28, 2021
584ca0b
make unique_handle constructible by nullhandle_t
DNKpp Dec 28, 2021
e77692e
add default ctor to unique_handle
DNKpp Dec 28, 2021
e81d527
add&test: symmetrical concept constructible_by
DNKpp Dec 28, 2021
c29c7bb
rename constructible_by to constructs and add docs
DNKpp Dec 28, 2021
6d0b0db
fix: include guards of concepts/stl_symmetrical.hpp
DNKpp Dec 28, 2021
e424e05
add&test&doc: assignable_to concept
DNKpp Dec 28, 2021
95b3f9b
add&test&docs: not_same_as concept
DNKpp Dec 28, 2021
2ed02a9
refactor: rename stl_symmetrical to stl_counterparts
DNKpp Dec 28, 2021
a65bb17
add&test: unique_handle ctor and assignment for its value types
DNKpp Dec 28, 2021
e45194f
add&test: unique_handle assignable from nullhandle_t
DNKpp Dec 28, 2021
7f6762c
test: use STATIC_REQUIRE where appropriate for unique_handle tests
DNKpp Dec 28, 2021
8632b0f
test: use better testing method for default constructibility of uniqu…
DNKpp Dec 28, 2021
7ee3c4e
add&test: unique_handle raw function
DNKpp Dec 28, 2021
b62d4b4
add&test: unique_handle operator *
DNKpp Dec 28, 2021
93e1f22
add&test: operator -> of unique_handle
DNKpp Dec 28, 2021
0c0de37
add&test: unique_handle reset function
DNKpp Dec 28, 2021
17327b3
docs: fix invalid keyword
DNKpp Dec 28, 2021
81f292a
add&test: delete action handling for unique_handle
DNKpp Dec 28, 2021
d204791
add&test: swap of unique_handle
DNKpp Dec 28, 2021
52efa8b
add: make unique_handle move ctor and assign conditionally noexcept
DNKpp Dec 29, 2021
3473e5d
test: add self move test case for unique_handle
DNKpp Dec 29, 2021
a61c47d
test: add self swap test case for unique_handle
DNKpp Dec 29, 2021
77f0f81
refactor: apply code formatting
DNKpp Dec 29, 2021
1537b53
fix: remove wrong nodiscard attribute
DNKpp Dec 29, 2021
0d92c55
fix: add missing noexcept declarations
DNKpp Dec 29, 2021
e32a099
fix: move unique_handle into correct subfolder
DNKpp Dec 29, 2021
fb5f983
fix: wrong include paths
DNKpp Dec 29, 2021
3ffebf3
fix: please gcc in test case code
DNKpp Dec 29, 2021
2851a64
add&test: in-place ctor and emplace function of unique_handle
DNKpp Dec 29, 2021
10eb629
test: some slight fixes
DNKpp Dec 29, 2021
e6c9784
add&test: constructor overloads for explicit delete action initializa…
DNKpp Dec 29, 2021
7ab1cbd
remove non-const delete_action from unique_handle
DNKpp Dec 29, 2021
d25fa04
add&test: various three-way-comparisons overloads for unique_handle
DNKpp Dec 29, 2021
d639ea9
fix: relax the constraint for unique_handle <=> value_type
DNKpp Dec 29, 2021
83b1457
fix: add compare include
DNKpp Dec 29, 2021
386e816
fix: please gcc
DNKpp Dec 29, 2021
6d72507
ci: adjust run_tests.yml
DNKpp Dec 29, 2021
db74580
docs: start documenting unique_handle
DNKpp Dec 30, 2021
3afcf89
fix: remove redundant reset of other in move ctor of unique_handle
DNKpp Dec 30, 2021
f06b6b2
remove CMakeSettings.json
DNKpp Dec 30, 2021
ba8c9fe
docs: extend unique_handle docs
DNKpp Dec 30, 2021
0424cfc
fix: unique_handle::emplace shouldn't return anything
DNKpp Dec 30, 2021
c7eb6d8
docs: adjust unique_handle docs
DNKpp Dec 30, 2021
721a7f4
fix: remove non-const operator -> of unique_handle
DNKpp Dec 30, 2021
800beea
docs: finalize unique_handle docs
DNKpp Dec 30, 2021
cc12da1
docs: fix wording
DNKpp Dec 30, 2021
c8f8f20
docs: finalize unique_handle docs
DNKpp Dec 30, 2021
0424792
add: explicit deduction guide for unique_handle
DNKpp Dec 30, 2021
45042f0
fix: make CATD of unique_handle with capturing lambda working
DNKpp Dec 30, 2021
3dd1087
add: unique_handle deduction guide for one parameter
DNKpp Dec 30, 2021
cbcea14
fix: add constraint for T not to be nullhandle_t in unique_handle
DNKpp Dec 30, 2021
925d386
fix: remove template param from default_delete_action
DNKpp Dec 30, 2021
0ac9932
refactor: rename element_type to value_type in unique_handle
DNKpp Dec 30, 2021
6d69227
improve unique_handle deduction guides
DNKpp Dec 30, 2021
3f53537
docs: exclude sl::detail namespace explicitly
DNKpp Dec 30, 2021
174ffe5
test: extend deduction guide tests of unique_handle
DNKpp Dec 30, 2021
5f27618
test: please clang <= 10
DNKpp Dec 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,45 @@ jobs:
sudo apt-get update
sudo apt-get install ${{ matrix.compiler.pkg }} -y
- name: Compile tests
working-directory: out
env:
CXX: ${{ matrix.compiler.exe }}
run: |
cmake -DSIMPLE_UTILITY_BUILD_TESTS=ON -S ..
make -j4
cmake -DSIMPLE_UTILITY_BUILD_TESTS=ON -B out -S .
cmake --build out -j4
- name: Run tests
working-directory: out/tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest --timeout 30 -C Debug -j4
run: ctest --test-dir out/tests --timeout 30 -C Debug -j4

windows:
runs-on: windows-latest
runs-on: windows-2022
timeout-minutes: 10

strategy:
fail-fast: false
matrix:
toolset: [v142, clang-cl]
toolset: [v142, v143, clang-cl]
include:
- toolset: v142
toolset_option: -T"v142"
- toolset: v143
toolset_option: -T"v143"
- toolset: clang-cl
toolset_option: -T"ClangCl"

steps:
- uses: actions/checkout@v2
- name: Compile tests
working-directory: out
run: |
cmake -DSIMPLE_UTILITY_BUILD_TESTS=ON ${{ matrix.toolset_option }} ..
cmake --build . -j 4
cmake -DSIMPLE_UTILITY_BUILD_TESTS=ON ${{ matrix.toolset_option }} -B out -S .
cmake --build out -j4
- name: Run tests
working-directory: out/tests
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest --timeout 30 -C Debug -j4
run: ctest --test-dir out/tests --timeout 30 -C Debug -j4

# macos:
# runs-on: macOS-latest
# runs-on: macos-latest
# timeout-minutes: 10
#
# strategy:
Expand All @@ -78,12 +76,11 @@ jobs:
# steps:
# - uses: actions/checkout@v2
# - name: Compile tests
# working-directory: out
# run: |
# cmake -DSIMPLE_UTILITY_BUILD_TESTS=ON ..
# make -j4
# cmake -DSIMPLE_UTILITY_BUILD_TESTS=ON -B out -S .
# cmake --build out -j4
# - name: Run tests
# working-directory: out/tests
# env:
# CTEST_OUTPUT_ON_FAILURE: 1
# run: ctest --timeout 30 -C Debug -j4
# run: ctest --test-dir out/tests --timeout 30 -C Debug -j4
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vs/

Folder.DotSettings*
Folder.DotSettings*
CMakeSettings.json
22 changes: 0 additions & 22 deletions CMakeSettings.json

This file was deleted.

2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ EXCLUDE_PATTERNS =
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories use the pattern */test/*

EXCLUDE_SYMBOLS =
EXCLUDE_SYMBOLS = sl::detail

# The EXAMPLE_PATH tag can be used to specify one or more files or directories
# that contain example code fragments that are included (see the \include
Expand Down
59 changes: 59 additions & 0 deletions include/Simple-Utility/concepts/stl_counterparts.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright Dominic Koepke 2019 - 2021.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)

#ifndef SL_STL_SYMMETRICAL_HPP
#define SL_STL_SYMMETRICAL_HPP

#pragma once

#include <concepts>

// ReSharper disable CppClangTidyClangDiagnosticDocumentation

namespace sl::concepts
{
/**
* \addtogroup concepts
* @{
*/

/**
* \defgroup stl_counterpart_concepts stl counterparts
* \brief This group offers counterpart concepts for existing stl concepts.
* @{
*/

/**
* \brief Checks whether the left-hand-side type is unequal to the right-hand-side type.
* \details This is the inverted counterpart of ``std::same_as`` concept.
* \tparam TLhs The source type handed over to the target
* \tparam TRhs The target type to check
*/
template <class TLhs, class TRhs>
concept not_same_as = !std::same_as<TLhs, TRhs>;

/**
* \brief Checks whether the target type is constructible from the source type.
* \details This is the symmetrical counterpart of ``std::constructible_from`` concept with a single constructor argument.
* \tparam TSource The source type handed over to the constructor of the target
* \tparam TTarget The target type to check
*/
template <class TSource, class TTarget>
concept constructs = std::constructible_from<TTarget, TSource>;

/**
* \brief Checks whether the target type is assignable from the source type.
* \details This is the symmetrical counterpart of ``std::assignable_from`` concept.
* \tparam TSource The source type handed over to the target
* \tparam TTarget The target type to check
*/
template <class TSource, class TTarget>
concept assignable_to = std::assignable_from<TTarget, TSource>;

/** @} */
/** @} */
}

#endif
Loading