From de4154aa18241e957acd2ba6d4d8cdf2b04a26cf Mon Sep 17 00:00:00 2001 From: Merry Date: Tue, 19 Apr 2022 12:12:19 +0100 Subject: [PATCH] externals: Remove mp and replace uses with mcl --- externals/CMakeLists.txt | 7 +- externals/README.md | 6 +- externals/mp/.travis.yml | 19 --- externals/mp/LICENSE-0BSD | 12 -- externals/mp/README.md | 122 ------------------ externals/mp/include/mp/metafunction/apply.h | 26 ---- externals/mp/include/mp/metafunction/bind.h | 19 --- .../mp/include/mp/metafunction/identity.h | 23 ---- externals/mp/include/mp/metafunction/map.h | 26 ---- externals/mp/include/mp/metavalue/bit_and.h | 20 --- externals/mp/include/mp/metavalue/bit_not.h | 20 --- externals/mp/include/mp/metavalue/bit_or.h | 20 --- externals/mp/include/mp/metavalue/bit_xor.h | 20 --- .../mp/include/mp/metavalue/conjunction.h | 43 ------ .../mp/include/mp/metavalue/disjunction.h | 43 ------ .../mp/include/mp/metavalue/lift_value.h | 16 --- externals/mp/include/mp/metavalue/logic_and.h | 20 --- externals/mp/include/mp/metavalue/logic_if.h | 21 --- externals/mp/include/mp/metavalue/logic_not.h | 20 --- externals/mp/include/mp/metavalue/logic_or.h | 20 --- externals/mp/include/mp/metavalue/product.h | 20 --- externals/mp/include/mp/metavalue/sum.h | 20 --- externals/mp/include/mp/metavalue/value.h | 31 ----- .../mp/include/mp/metavalue/value_cast.h | 16 --- .../mp/include/mp/metavalue/value_equal.h | 16 --- externals/mp/include/mp/misc/argument_count.h | 20 --- .../mp/include/mp/traits/function_info.h | 71 ---------- .../mp/include/mp/traits/integer_of_size.h | 50 ------- .../mp/traits/is_instance_of_template.h | 23 ---- externals/mp/include/mp/typelist/append.h | 26 ---- .../include/mp/typelist/cartesian_product.h | 50 ------- externals/mp/include/mp/typelist/concat.h | 56 -------- externals/mp/include/mp/typelist/contains.h | 25 ---- externals/mp/include/mp/typelist/drop.h | 34 ----- externals/mp/include/mp/typelist/get.h | 19 --- externals/mp/include/mp/typelist/head.h | 26 ---- externals/mp/include/mp/typelist/length.h | 21 --- .../mp/include/mp/typelist/lift_sequence.h | 30 ----- externals/mp/include/mp/typelist/list.h | 14 -- .../mp/include/mp/typelist/lower_to_tuple.h | 25 ---- externals/mp/include/mp/typelist/prepend.h | 26 ---- externals/mp/include/mp/typelist/tail.h | 26 ---- externals/mp/tests/all_tests.cpp | 12 -- externals/mp/tests/metavalue_tests.h | 93 ------------- externals/mp/tests/traits_tests.h | 42 ------ externals/mp/tests/typelist_tests.h | 113 ---------------- src/dynarmic/CMakeLists.txt | 4 +- .../backend/x64/a32_emit_x64_memory.cpp | 2 +- src/dynarmic/backend/x64/a64_emit_x64.cpp | 2 +- .../backend/x64/a64_emit_x64_memory.cpp | 2 +- src/dynarmic/backend/x64/devirtualize.h | 10 +- .../backend/x64/emit_x64_floating_point.cpp | 41 +++--- .../backend/x64/emit_x64_memory.cpp.inc | 4 +- .../backend/x64/emit_x64_saturation.cpp | 6 +- src/dynarmic/backend/x64/emit_x64_vector.cpp | 10 +- .../x64/emit_x64_vector_floating_point.cpp | 53 ++++---- src/dynarmic/common/cast_util.h | 4 +- src/dynarmic/common/lut_from_list.h | 16 +-- .../frontend/decoder/decoder_detail.h | 6 +- tests/CMakeLists.txt | 4 +- 60 files changed, 90 insertions(+), 1502 deletions(-) delete mode 100644 externals/mp/.travis.yml delete mode 100644 externals/mp/LICENSE-0BSD delete mode 100644 externals/mp/README.md delete mode 100644 externals/mp/include/mp/metafunction/apply.h delete mode 100644 externals/mp/include/mp/metafunction/bind.h delete mode 100644 externals/mp/include/mp/metafunction/identity.h delete mode 100644 externals/mp/include/mp/metafunction/map.h delete mode 100644 externals/mp/include/mp/metavalue/bit_and.h delete mode 100644 externals/mp/include/mp/metavalue/bit_not.h delete mode 100644 externals/mp/include/mp/metavalue/bit_or.h delete mode 100644 externals/mp/include/mp/metavalue/bit_xor.h delete mode 100644 externals/mp/include/mp/metavalue/conjunction.h delete mode 100644 externals/mp/include/mp/metavalue/disjunction.h delete mode 100644 externals/mp/include/mp/metavalue/lift_value.h delete mode 100644 externals/mp/include/mp/metavalue/logic_and.h delete mode 100644 externals/mp/include/mp/metavalue/logic_if.h delete mode 100644 externals/mp/include/mp/metavalue/logic_not.h delete mode 100644 externals/mp/include/mp/metavalue/logic_or.h delete mode 100644 externals/mp/include/mp/metavalue/product.h delete mode 100644 externals/mp/include/mp/metavalue/sum.h delete mode 100644 externals/mp/include/mp/metavalue/value.h delete mode 100644 externals/mp/include/mp/metavalue/value_cast.h delete mode 100644 externals/mp/include/mp/metavalue/value_equal.h delete mode 100644 externals/mp/include/mp/misc/argument_count.h delete mode 100644 externals/mp/include/mp/traits/function_info.h delete mode 100644 externals/mp/include/mp/traits/integer_of_size.h delete mode 100644 externals/mp/include/mp/traits/is_instance_of_template.h delete mode 100644 externals/mp/include/mp/typelist/append.h delete mode 100644 externals/mp/include/mp/typelist/cartesian_product.h delete mode 100644 externals/mp/include/mp/typelist/concat.h delete mode 100644 externals/mp/include/mp/typelist/contains.h delete mode 100644 externals/mp/include/mp/typelist/drop.h delete mode 100644 externals/mp/include/mp/typelist/get.h delete mode 100644 externals/mp/include/mp/typelist/head.h delete mode 100644 externals/mp/include/mp/typelist/length.h delete mode 100644 externals/mp/include/mp/typelist/lift_sequence.h delete mode 100644 externals/mp/include/mp/typelist/list.h delete mode 100644 externals/mp/include/mp/typelist/lower_to_tuple.h delete mode 100644 externals/mp/include/mp/typelist/prepend.h delete mode 100644 externals/mp/include/mp/typelist/tail.h delete mode 100644 externals/mp/tests/all_tests.cpp delete mode 100644 externals/mp/tests/metavalue_tests.h delete mode 100644 externals/mp/tests/traits_tests.h delete mode 100644 externals/mp/tests/typelist_tests.h diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index c9649515..7adf018f 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -19,10 +19,11 @@ if (NOT TARGET fmt AND NOT TARGET fmt::fmt) add_subdirectory(fmt) endif() -# mp +# mcl -add_library(mp INTERFACE) -target_include_directories(mp INTERFACE $) +if (NOT TARGET merry::mcl) + add_subdirectory(mcl) +endif() # robin-map diff --git a/externals/README.md b/externals/README.md index 94ba26b0..0994cad4 100644 --- a/externals/README.md +++ b/externals/README.md @@ -4,7 +4,7 @@ This repository uses subtrees to manage some of its externals. ``` git remote add externals-fmt https://github.com/fmtlib/fmt.git --no-tags -git remote add externals-mp https://github.com/MerryMage/mp.git --no-tags +git remote add externals-mcl https://github.com/merryhime/mcl.git --no-tags git remote add externals-robin-map https://github.com/Tessil/robin-map.git --no-tags git remote add externals-vixl https://git.linaro.org/arm/vixl.git --no-tags git remote add externals-xbyak https://github.com/herumi/xbyak.git --no-tags @@ -18,14 +18,14 @@ Change `` to refer to the appropriate git reference. ``` git fetch externals-fmt -git fetch externals-mp +git fetch externals-mcl git fetch externals-robin-map git fetch externals-vixl git fetch externals-xbyak git fetch externals-zycore git fetch externals-zydis git subtree pull --squash --prefix=externals/fmt externals-fmt -git subtree pull --squash --prefix=externals/mp externals-mp +git subtree pull --squash --prefix=externals/mcl externals-mcl git subtree pull --squash --prefix=externals/robin-map externals-robin-map git subtree pull --squash --prefix=externals/vixl/vixl externals-vixl git subtree pull --squash --prefix=externals/xbyak externals-xbyak diff --git a/externals/mp/.travis.yml b/externals/mp/.travis.yml deleted file mode 100644 index 8d77227c..00000000 --- a/externals/mp/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: cpp -os: linux - -matrix: - - compiler: clang - env: CXX=clang - dist: bionic - - compiler: g++-8 - env: CXX=g++-8 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-8 - -script: - - $CXX --version - - $CXX -I./include -std=c++17 -Wall -Wextra -Wcast-qual -pedantic -pedantic-errors -Werror tests/all_tests.cpp diff --git a/externals/mp/LICENSE-0BSD b/externals/mp/LICENSE-0BSD deleted file mode 100644 index 6de06bcf..00000000 --- a/externals/mp/LICENSE-0BSD +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (C) 2017 MerryMage - -Permission to use, copy, modify, and/or distribute this software for -any purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN -AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/externals/mp/README.md b/externals/mp/README.md deleted file mode 100644 index 58529461..00000000 --- a/externals/mp/README.md +++ /dev/null @@ -1,122 +0,0 @@ -mp -=== - -A small, 0BSD-licensed metaprogramming library for C++17. - -This is intended to be a lightweight and easy to understand implementation of a subset of useful metaprogramming utilities. - -Usage ------ - -Just add the `include` directory to your include path. That's it. - -`typelist` ----------- - -A `mp::list` is a list of types. This set of headers provide metafunctions for manipulating lists of types. - -### Constructor - -* `mp::list`: Constructs a list. -* `mp::lift_sequence`: Lifts a value sequence into a list. Intended for use on `std::integral_sequence`. - -### Element access - -* `mp::get`: Gets a numbered element of a list. -* `mp::head`: Gets the first element of a list. -* `mp::tail`: Gets all-but-the-first-element as a list. - -### Properties - -* `mp::length`: Gets the length of a list. -* `mp::contains`: Determines if this list contains a specified element. - -### Modifiers - -* `mp::append`: Constructs a list with the provided elements appended to it. -* `mp::prepend`: Constructs a list with the provided elements prepended to it. - -### Operations - -* `mp::concat`: Concantenates multiple lists together. -* `mp::cartesian_product`: Construct a list containing the [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) of the provided lists. - -### Conversions - -* `mp::lower_to_tuple`: This operation only works on a list solely containing metavalues. Results in a `std::tuple` with equivalent values. - - -`metavalue` ------------ - -A metavalue is a type of template `std::integral_constant`. - -### Constants - -* mp::true_type: Aliases to [`std::true_type`](https://en.cppreference.com/w/cpp/types/integral_constant) -* mp::false_type: Aliases to [`mp::false_type`](https://en.cppreference.com/w/cpp/types/integral_constant) - -### Constructor - -* mp::value: Aliases to [`std::integral_constant`](https://en.cppreference.com/w/cpp/types/integral_constant) -* mp::bool_value: Aliases to [`std::bool_constant`](https://en.cppreference.com/w/cpp/types/integral_constant) -* mp::size_value: Constructs a metavalue with value of type std::size_t -* `mp::lift_value`: Lifts a value of any arbitrary type to become a metavalue - -### Conversions - -* `mp::value_cast` - -### Operations - -* `mp::value_equal`: Compares value equality, ignores type. Use `std::is_same` for strict comparison. -* `mp::logic_if`: Like std::conditional but has a bool metavalue as first argument. -* `mp::bit_not`: Bitwise not -* `mp::bit_and`: Bitwise and -* `mp::bit_or`: Bitwise or -* `mp::bit_xor`: Bitwise xor -* `mp::logic_not`: Logical not -* `mp::logic_and`: Logical conjunction (no short circuiting, always results in a mp:bool_value) -* `mp::logic_or`: Logical disjunction (no short circuiting, always results in a mp:bool_value) -* `mp::conjunction`: Logical conjunction (with short circuiting, preserves type) -* `mp::disjunction`: Logical disjunction (with short circuiting, preserves type) -* `mp::sum`: Sum of values -* `mp::product`: Product of values - -`metafunction` --------------- - -* `std::void_t`: Always returns `void`. -* `mp::identity`: Identity metafunction. Can be used to establish a non-deduced context. See also C++20 `std::type_identity`. -* `mp::apply`: Invoke a provided metafunction with arguments specified in a list. -* `mp::map`: Apply a provided metafunction to each element of a list. -* `mp::bind`: Curry a metafunction. A macro `MM_MP_BIND` is provided to make this a little prettier. - -`traits` --------- - -Type traits not in the standard library. - -### `function_info` - -* `mp::parameter_count_v`: Number of parameters a function has -* `mp::parameter_list`: Get a typelist of the parameter types -* `mp::get_parameter`: Get the type of a parameter by index -* `mp::equivalent_function_type`: Get an equivalent function type (for MFPs this does not include the class) -* `mp::equivalent_function_type_with_class`: Get an equivalent function type with explicit `this` argument (MFPs only) -* `mp::return_type`: Return type of the function -* `mp::class_type`: Only valid for member function pointer types. Gets the class the member function is associated with. - -### `integer_of_size` - -* `mp::signed_integer_of_size`: Gets a signed integer of the specified bit-size (if it exists) -* `mp::unsigned_integer_of_size`: Gets an unsigned integer of the specified bit-size (if it exists) - -### Misc - -* `mp::is_instance_of_template`: Checks if a type is an instance of a template class. - -License -------- - -Please see [LICENSE-0BSD](LICENSE-0BSD). diff --git a/externals/mp/include/mp/metafunction/apply.h b/externals/mp/include/mp/metafunction/apply.h deleted file mode 100644 index 3ab0d960..00000000 --- a/externals/mp/include/mp/metafunction/apply.h +++ /dev/null @@ -1,26 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -namespace mp { - -namespace detail { - -template class F, class L> -struct apply_impl; - -template class F, template class LT, class... Es> -struct apply_impl> { - using type = F; -}; - -} // namespace detail - -/// Invokes metafunction F where the arguments are all the members of list L -template class F, class L> -using apply = typename detail::apply_impl::type; - -} // namespace mp diff --git a/externals/mp/include/mp/metafunction/bind.h b/externals/mp/include/mp/metafunction/bind.h deleted file mode 100644 index ec3b5163..00000000 --- a/externals/mp/include/mp/metafunction/bind.h +++ /dev/null @@ -1,19 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -namespace mp { - -/// Binds the first sizeof...(A) arguments of metafunction F with arguments A -template class F, class... As> -struct bind { - template - using type = F; -}; - -} // namespace mp - -#define MM_MP_BIND(...) ::mp::bind<__VA_ARGS__>::template type diff --git a/externals/mp/include/mp/metafunction/identity.h b/externals/mp/include/mp/metafunction/identity.h deleted file mode 100644 index 661af9a6..00000000 --- a/externals/mp/include/mp/metafunction/identity.h +++ /dev/null @@ -1,23 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -namespace mp { - -namespace detail { - -template -struct identity_impl { - using type = T; -}; - -} // namespace detail - -/// Identity metafunction -template -using identity = typename identity_impl::type; - -} // namespace mp diff --git a/externals/mp/include/mp/metafunction/map.h b/externals/mp/include/mp/metafunction/map.h deleted file mode 100644 index 28aa1f5b..00000000 --- a/externals/mp/include/mp/metafunction/map.h +++ /dev/null @@ -1,26 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -namespace mp { - -namespace detail { - -template class F, class L> -struct map_impl; - -template class F, template class LT, class... Es> -struct map_impl> { - using type = LT...>; -}; - -} // namespace detail - -/// Applies each element of list L to metafunction F -template class F, class L> -using map = typename detail::map_impl::type; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/bit_and.h b/externals/mp/include/mp/metavalue/bit_and.h deleted file mode 100644 index 3124266a..00000000 --- a/externals/mp/include/mp/metavalue/bit_and.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Bitwise and of metavalues Vs -template -using bit_and = lift_value<(Vs::value & ...)>; - -/// Bitwise and of metavalues Vs -template -constexpr auto bit_and_v = (Vs::value & ...); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/bit_not.h b/externals/mp/include/mp/metavalue/bit_not.h deleted file mode 100644 index 4aa7d846..00000000 --- a/externals/mp/include/mp/metavalue/bit_not.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Bitwise not of metavalue V -template -using bit_not = lift_value<~V::value>; - -/// Bitwise not of metavalue V -template -constexpr auto bit_not_v = ~V::value; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/bit_or.h b/externals/mp/include/mp/metavalue/bit_or.h deleted file mode 100644 index 6e39d227..00000000 --- a/externals/mp/include/mp/metavalue/bit_or.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Bitwise or of metavalues Vs -template -using bit_or = lift_value<(Vs::value | ...)>; - -/// Bitwise or of metavalues Vs -template -constexpr auto bit_or_v = (Vs::value | ...); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/bit_xor.h b/externals/mp/include/mp/metavalue/bit_xor.h deleted file mode 100644 index 6b0463d9..00000000 --- a/externals/mp/include/mp/metavalue/bit_xor.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Bitwise xor of metavalues Vs -template -using bit_xor = lift_value<(Vs::value ^ ...)>; - -/// Bitwise xor of metavalues Vs -template -constexpr auto bit_xor_v = (Vs::value ^ ...); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/conjunction.h b/externals/mp/include/mp/metavalue/conjunction.h deleted file mode 100644 index 7038b27f..00000000 --- a/externals/mp/include/mp/metavalue/conjunction.h +++ /dev/null @@ -1,43 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include -#include - -namespace mp { - -namespace detail { - -template -struct conjunction_impl; - -template<> -struct conjunction_impl<> { - using type = false_type; -}; - -template -struct conjunction_impl { - using type = V; -}; - -template -struct conjunction_impl { - using type = logic_if::type, V1>; -}; - -} // namespace detail - -/// Conjunction of metavalues Vs with short-circuiting and type preservation. -template -using conjunction = typename detail::conjunction_impl::type; - -/// Conjunction of metavalues Vs with short-circuiting and type preservation. -template -constexpr auto conjunction_v = conjunction::value; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/disjunction.h b/externals/mp/include/mp/metavalue/disjunction.h deleted file mode 100644 index b5f5c3b5..00000000 --- a/externals/mp/include/mp/metavalue/disjunction.h +++ /dev/null @@ -1,43 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include -#include - -namespace mp { - -namespace detail { - -template -struct disjunction_impl; - -template<> -struct disjunction_impl<> { - using type = false_type; -}; - -template -struct disjunction_impl { - using type = V; -}; - -template -struct disjunction_impl { - using type = logic_if::type>; -}; - -} // namespace detail - -/// Disjunction of metavalues Vs with short-circuiting and type preservation. -template -using disjunction = typename detail::disjunction_impl::type; - -/// Disjunction of metavalues Vs with short-circuiting and type preservation. -template -constexpr auto disjunction_v = disjunction::value; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/lift_value.h b/externals/mp/include/mp/metavalue/lift_value.h deleted file mode 100644 index 74dd3347..00000000 --- a/externals/mp/include/mp/metavalue/lift_value.h +++ /dev/null @@ -1,16 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Lifts a value into a type (a metavalue) -template -using lift_value = std::integral_constant; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/logic_and.h b/externals/mp/include/mp/metavalue/logic_and.h deleted file mode 100644 index 5e4a1f73..00000000 --- a/externals/mp/include/mp/metavalue/logic_and.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Logical conjunction of metavalues Vs without short-circuiting or type presevation. -template -using logic_and = bool_value<(true && ... && Vs::value)>; - -/// Logical conjunction of metavalues Vs without short-circuiting or type presevation. -template -constexpr bool logic_and_v = (true && ... && Vs::value); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/logic_if.h b/externals/mp/include/mp/metavalue/logic_if.h deleted file mode 100644 index a548d8ab..00000000 --- a/externals/mp/include/mp/metavalue/logic_if.h +++ /dev/null @@ -1,21 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include -#include - -namespace mp { - -/// Conditionally select between types T and F based on boolean metavalue V -template -using logic_if = std::conditional_t; - -/// Conditionally select between metavalues T and F based on boolean metavalue V -template -constexpr auto logic_if_v = logic_if::value; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/logic_not.h b/externals/mp/include/mp/metavalue/logic_not.h deleted file mode 100644 index b2cf79c4..00000000 --- a/externals/mp/include/mp/metavalue/logic_not.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Logical negation of metavalue V. -template -using logic_not = bool_value; - -/// Logical negation of metavalue V. -template -constexpr bool logic_not_v = !bool(V::value); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/logic_or.h b/externals/mp/include/mp/metavalue/logic_or.h deleted file mode 100644 index 030b4995..00000000 --- a/externals/mp/include/mp/metavalue/logic_or.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Logical disjunction of metavalues Vs without short-circuiting or type presevation. -template -using logic_or = bool_value<(false || ... || Vs::value)>; - -/// Logical disjunction of metavalues Vs without short-circuiting or type presevation. -template -constexpr bool logic_or_v = (false || ... || Vs::value); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/product.h b/externals/mp/include/mp/metavalue/product.h deleted file mode 100644 index 99a679ce..00000000 --- a/externals/mp/include/mp/metavalue/product.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Product of metavalues Vs -template -using product = lift_value<(Vs::value * ...)>; - -/// Product of metavalues Vs -template -constexpr auto product_v = (Vs::value * ...); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/sum.h b/externals/mp/include/mp/metavalue/sum.h deleted file mode 100644 index 02dbfef7..00000000 --- a/externals/mp/include/mp/metavalue/sum.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Sum of metavalues Vs -template -using sum = lift_value<(Vs::value + ...)>; - -/// Sum of metavalues Vs -template -constexpr auto sum_v = (Vs::value + ...); - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/value.h b/externals/mp/include/mp/metavalue/value.h deleted file mode 100644 index e57df6f7..00000000 --- a/externals/mp/include/mp/metavalue/value.h +++ /dev/null @@ -1,31 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include -#include - -namespace mp { - -/// A metavalue (of type VT and value v). -template -using value = std::integral_constant; - -/// A metavalue of type std::size_t (and value v). -template -using size_value = value; - -/// A metavalue of type bool (and value v). (Aliases to std::bool_constant.) -template -using bool_value = value; - -/// true metavalue (Aliases to std::true_type). -using true_type = bool_value; - -/// false metavalue (Aliases to std::false_type). -using false_type = bool_value; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/value_cast.h b/externals/mp/include/mp/metavalue/value_cast.h deleted file mode 100644 index a05e45ee..00000000 --- a/externals/mp/include/mp/metavalue/value_cast.h +++ /dev/null @@ -1,16 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Casts a metavalue from one type to another -template -using value_cast = std::integral_constant(V::value)>; - -} // namespace mp diff --git a/externals/mp/include/mp/metavalue/value_equal.h b/externals/mp/include/mp/metavalue/value_equal.h deleted file mode 100644 index dde387f9..00000000 --- a/externals/mp/include/mp/metavalue/value_equal.h +++ /dev/null @@ -1,16 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Do two metavalues contain the same value? -template -using value_equal = std::bool_constant; - -} // namespace mp diff --git a/externals/mp/include/mp/misc/argument_count.h b/externals/mp/include/mp/misc/argument_count.h deleted file mode 100644 index f334b69c..00000000 --- a/externals/mp/include/mp/misc/argument_count.h +++ /dev/null @@ -1,20 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Metafunction that returns the number of arguments it has -template -using argument_count = lift_value; - -/// Metafunction that returns the number of arguments it has -template -constexpr auto argument_count_v = sizeof...(Ts); - -} // namespace mp diff --git a/externals/mp/include/mp/traits/function_info.h b/externals/mp/include/mp/traits/function_info.h deleted file mode 100644 index 85dc9a91..00000000 --- a/externals/mp/include/mp/traits/function_info.h +++ /dev/null @@ -1,71 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2017 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include -#include - -#include - -namespace mp { - -template -struct function_info : function_info {}; - -template -struct function_info { - using return_type = R; - using parameter_list = list; - static constexpr std::size_t parameter_count = sizeof...(As); - - using equivalent_function_type = R(As...); - - template - struct parameter { - static_assert(I < parameter_count, "Non-existent parameter"); - using type = std::tuple_element_t>; - }; -}; - -template -struct function_info : function_info {}; - -template -struct function_info : function_info { - using class_type = C; - - using equivalent_function_type_with_class = R(C*, As...); -}; - -template -struct function_info : function_info { - using class_type = C; - - using equivalent_function_type_with_class = R(C*, As...); -}; - -template -constexpr size_t parameter_count_v = function_info::parameter_count; - -template -using parameter_list = typename function_info::parameter_list; - -template -using get_parameter = typename function_info::template parameter::type; - -template -using equivalent_function_type = typename function_info::equivalent_function_type; - -template -using equivalent_function_type_with_class = typename function_info::equivalent_function_type_with_class; - -template -using return_type = typename function_info::return_type; - -template -using class_type = typename function_info::class_type; - -} // namespace mp diff --git a/externals/mp/include/mp/traits/integer_of_size.h b/externals/mp/include/mp/traits/integer_of_size.h deleted file mode 100644 index 651b1636..00000000 --- a/externals/mp/include/mp/traits/integer_of_size.h +++ /dev/null @@ -1,50 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2018 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include -#include - -namespace mp { - -namespace detail { - -template -struct integer_of_size_impl{}; - -template<> -struct integer_of_size_impl<8> { - using unsigned_type = std::uint8_t; - using signed_type = std::int8_t; -}; - -template<> -struct integer_of_size_impl<16> { - using unsigned_type = std::uint16_t; - using signed_type = std::int16_t; -}; - -template<> -struct integer_of_size_impl<32> { - using unsigned_type = std::uint32_t; - using signed_type = std::int32_t; -}; - -template<> -struct integer_of_size_impl<64> { - using unsigned_type = std::uint64_t; - using signed_type = std::int64_t; -}; - -} // namespace detail - -template -using unsigned_integer_of_size = typename detail::integer_of_size_impl::unsigned_type; - -template -using signed_integer_of_size = typename detail::integer_of_size_impl::signed_type; - -} // namespace mp diff --git a/externals/mp/include/mp/traits/is_instance_of_template.h b/externals/mp/include/mp/traits/is_instance_of_template.h deleted file mode 100644 index d30bba57..00000000 --- a/externals/mp/include/mp/traits/is_instance_of_template.h +++ /dev/null @@ -1,23 +0,0 @@ -/* This file is part of the mp project. - * Copyright (c) 2020 MerryMage - * SPDX-License-Identifier: 0BSD - */ - -#pragma once - -#include - -namespace mp { - -/// Is type T an instance of template class C? -template