diff --git a/src/cpputils/container.h b/src/cpputils/container.h deleted file mode 100644 index 8d341b1..0000000 --- a/src/cpputils/container.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include -#include -#include \ No newline at end of file diff --git a/src/cpputils/logging.h b/src/cpputils/logging.h deleted file mode 100644 index e69de29..0000000 diff --git a/src/cpputils/misc.h b/src/cpputils/misc.h deleted file mode 100644 index 84b6cd2..0000000 --- a/src/cpputils/misc.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include \ No newline at end of file diff --git a/src/cpputils/mp.h b/src/cpputils/mp.h index 1016fc8..1a03e9c 100644 --- a/src/cpputils/mp.h +++ b/src/cpputils/mp.h @@ -1,7 +1,3 @@ #pragma once -#include -#include -#include -#include -#include \ No newline at end of file +#include \ No newline at end of file diff --git a/src/cpputils/mp/LICENSE.md b/src/cpputils/mp/LICENSE.md deleted file mode 100644 index fe7ba3a..0000000 --- a/src/cpputils/mp/LICENSE.md +++ /dev/null @@ -1,34 +0,0 @@ -== License of this adaptation == - -Copyright Erik Junghanns. - - - -== Original boost::hana license == - -Copyright Louis Dionne 2013-2017 - -Boost Software License - Version 1.0 - August 17th, 2003 - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - diff --git a/src/cpputils/mp/README.md b/src/cpputils/mp/README.md deleted file mode 100644 index 8b44a9f..0000000 --- a/src/cpputils/mp/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This is an adaptation of the boost::hana library. -See https://github.com/boostorg/hana diff --git a/src/cpputils/mp/container.h b/src/cpputils/mp/container.h deleted file mode 100644 index 9af1b05..0000000 --- a/src/cpputils/mp/container.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#include -#include -#include -#include diff --git a/src/cpputils/mp/container/basic_tuple.h b/src/cpputils/mp/container/basic_tuple.h deleted file mode 100644 index 8e2d1d1..0000000 --- a/src/cpputils/mp/container/basic_tuple.h +++ /dev/null @@ -1,159 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace utl { -namespace mp { - - struct tag_basic_tuple { }; - - namespace __impl - { - template - struct basic_tuple_index; - - template - struct basic_tuple_impl; - - struct basic_tuple_from_other { }; - - template - struct basic_tuple_impl, Xn...> - : intern::ebo, Xn>... - { - static constexpr size_t _size = sizeof...(Xn); - - constexpr basic_tuple_impl() = default; - - template - explicit constexpr basic_tuple_impl(basic_tuple_from_other, Other&& other) - : intern::ebo, Xn>(intern::ebo_get>(std::forward(other)))... - { } - - template - explicit constexpr basic_tuple_impl(Yn&&... yn) - : intern::ebo, Xn>(std::forward(yn))... - { } - }; - } - - template - struct basic_tuple final - : __impl::basic_tuple_impl, Xn...> - { - using tag = tag_basic_tuple; - using base_type = __impl::basic_tuple_impl, Xn...>; - - constexpr basic_tuple() = default; - - template>>> - constexpr basic_tuple(Other&& other) - : base_type(__impl::basic_tuple_from_other { }, std::forward(other)) - { } - - template - explicit constexpr basic_tuple(Yn&&... yn) - : base_type(std::forward(yn)...) - { } - - template - constexpr auto at(const N& n) const - { return mp::at(*this, n); } - - template - constexpr auto unpack(F&& f) const - { return mp::unpack(*this, std::forward(f)); } - - template - constexpr auto transform(F&& f) const - { return mp::transform(*this, std::forward(f)); } - }; - - constexpr auto make_basic_tuple = make; - - namespace __impl - { - /* tag_of */ - template - struct tag_of_impl> - { using type = tag_basic_tuple; }; - - /* make */ - template<> - struct make_impl - { - template - static constexpr auto apply(Xn&&... xn) - { return basic_tuple...> { std::forward(xn)... }; } - }; - - /* unpack */ - template<> - struct unpack_impl - { - template - static constexpr auto apply(const basic_tuple_impl, Xn...>& xs, F&& f) - { - return std::forward(f)( - intern::ebo_get>( - static_cast, Xn>&>(xs) - )... - ); - } - - template - static constexpr auto apply(basic_tuple_impl, Xn...>& xs, F&& f) - { - return std::forward(f)( - intern::ebo_get>( - static_cast, Xn>&>(xs) - )... - ); - } - - template - static constexpr auto apply(basic_tuple_impl, Xn...>&& xs, F&& f) - { - return std::forward(f)( - intern::ebo_get>( - static_cast, Xn>&&>(xs) - )... - ); - } - }; - - /* at */ - template<> - struct at_impl - { - template - static constexpr auto apply(Xs&& xs, const N&) - { - constexpr size_t index = N::value; - return intern::ebo_get>(std::forward(xs)); - } - }; - } - - template - constexpr auto at_c(const basic_tuple& x) - { return intern::ebo_get<__impl::basic_tuple_index>(x); } - - template - constexpr auto at_c(basic_tuple& x) - { return intern::ebo_get<__impl::basic_tuple_index>(x); } - - template - constexpr auto at_c(basic_tuple&& x) - { return intern::ebo_get<__impl::basic_tuple_index>(std::forward>(x)); } - -} -} \ No newline at end of file diff --git a/src/cpputils/mp/container/map.h b/src/cpputils/mp/container/map.h deleted file mode 100644 index 4705b94..0000000 --- a/src/cpputils/mp/container/map.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace utl { -namespace mp { - - struct tag_map { }; - - constexpr auto make_map = make; - - constexpr auto to_map = make; - - namespace __impl /* forward declaration */ - { - template - struct make_map_type; - } - - template - using map = typename __impl::make_map_type::type; - - namespace __impl /* implementation */ - { - template - struct make_map_type - { - using storage_type = basic_tuple; - - }; - } - -} -} \ No newline at end of file diff --git a/src/cpputils/mp/container/pair.h b/src/cpputils/mp/container/pair.h deleted file mode 100644 index 8d5353d..0000000 --- a/src/cpputils/mp/container/pair.h +++ /dev/null @@ -1,239 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace utl { -namespace mp { - - struct tag_pair { }; - - constexpr auto make_pair = make; - - namespace __impl - { - template - struct pair_index; - } - - template - struct pair : - private intern::ebo<__impl::pair_index<0>, First>, - private intern::ebo<__impl::pair_index<1>, Second> - { - using tag = tag_pair; - using this_type = pair; - - // default constructor - template::value && - is_constructible::value>> - constexpr pair() - : intern::ebo<__impl::pair_index<0>, First>() - , intern::ebo<__impl::pair_index<1>, Second>() - { } - - // variadic constructors - template::value && - is_constructible::value>> - constexpr pair(First f, Second s) - : intern::ebo<__impl::pair_index<0>, First>(f) - , intern::ebo<__impl::pair_index<1>, Second>(s) - { } - - template::value && - is_convertible::value>> - constexpr pair(F&& f, S&& s) - : intern::ebo<__impl::pair_index<0>, First>(std::forward(f)) - , intern::ebo<__impl::pair_index<1>, Second>(std::forward(s)) - { } - - // copy and move constructor - template::value && - is_constructible::value && - is_convertible::value && - is_convertible::value>> - constexpr pair(const pair& other) - : intern::ebo<__impl::pair_index<0>, First>(mp::first(other)) - , intern::ebo<__impl::pair_index<1>, Second>(mp::second(other)) - { } - - template::value && - is_constructible::value && - is_convertible::value && - is_convertible::value>> - constexpr pair(pair&& other) - : intern::ebo<__impl::pair_index<0>, First>(mp::first(std::forward>(other))) - , intern::ebo<__impl::pair_index<1>, Second>(mp::second(std::forward>(other))) - { } - - // copy and move assignment - template ::value && - is_assignable::value>> - constexpr pair& operator=(const pair& other) { - mp::first(*this) = mp::first(other); - mp::second(*this) = mp::second(other); - return *this; - } - - template ::value && - is_assignable::value>> - constexpr pair& operator=(pair&& other) { - mp::first(*this) = mp::first(std::move>(other)); - mp::second(*this) = mp::second(std::move>(other)); - return *this; - } - - constexpr auto first() const - { return mp::first(*this); } - - constexpr auto second() const - { return mp::second(*this); } - - // Prevent the compiler from defining the default copy and move - // constructors, which interfere with the SFINAE above. - ~pair() = default; - - friend struct __impl::first_impl; - friend struct __impl::second_impl; - }; - - namespace intern { - - template<> - struct operators_comparable - { static constexpr bool value = true; }; - - template<> - struct operators_orderable - { static constexpr bool value = true; }; - - } - - namespace __impl - { - /* tag_of */ - template - struct tag_of_impl> - { using type = tag_pair; }; - - /* make */ - template<> - struct make_impl - { - template - static constexpr pair, decay_type> apply(F&& f, S&& s) - { return { static_cast(f), static_cast(s) }; } - }; - - /* first */ - template<> - struct first_impl - { - using type = int; - - template - static constexpr auto apply(pair& p) - { - return intern::ebo_get>( - static_cast, First>&>(p) - ); - } - - template - static constexpr auto apply(pair&& p) - { - return intern::ebo_get>( - static_cast, First>&&>(p) - ); - } - - template - static constexpr auto apply(const pair& p) - { - return intern::ebo_get>( - static_cast, First>&>(p) - ); - } - }; - - /* second */ - template<> - struct second_impl - { - template - static constexpr auto apply(pair& p) - { - return intern::ebo_get>( - static_cast, Second>&>(p) - ); - } - - template - static constexpr auto apply(pair&& p) - { - return intern::ebo_get>( - static_cast, Second>&&>(p) - ); - } - - template - static constexpr auto apply(const pair& p) - { - return intern::ebo_get>( - static_cast, Second>&>(p) - ); - } - }; - - /* equal */ - template<> - struct equal_impl - { - template - static constexpr auto apply(const L& l, const R& r) - { - return and_( - equal(first(l), first(r)), - equal(second(l), second(r))); - } - }; - - /* less */ - template<> - struct less_impl - { - template - static constexpr auto apply(const L& l, const R& r) - { - return or_( - less(first(l), first(r)), - and_( - less_equal(first (l), first (r)), - less (second(l), second(r)) - ) - ); - } - }; - } - -} -} \ No newline at end of file diff --git a/src/cpputils/mp/container/type.h b/src/cpputils/mp/container/type.h deleted file mode 100644 index c8e2451..0000000 --- a/src/cpputils/mp/container/type.h +++ /dev/null @@ -1,268 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include - -namespace utl { -namespace mp { - - namespace __impl /* forward declaration */ - { - template - struct type_impl; - - struct decl_type_t - { - template - constexpr auto operator()(T&& t) const; - }; - - struct type_id_t - { - template - constexpr auto operator()(T&&) const; - }; - - struct size_of_t - { - template - constexpr auto operator()(T&&) const; - }; - - struct align_of_t - { - template - constexpr auto operator()(T&&) const; - }; - - struct is_valid_type_t - { - template - constexpr auto operator()(F&&) const; - - template - constexpr auto operator()(F&&, Args&&...) const; - }; - - template