Changeset 8f8f1d1e in mainline


Ignore:
Timestamp:
2018-07-05T21:41:23Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f6f636f
Parents:
0e5e8bf9
git-author:
Dzejrou <dzejrou@…> (2018-05-12 17:12:15)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: removed usage of _v aliases and added forward declarations instead, this avoids possible circular reference

Location:
uspace/lib/cpp/include/internal/functional
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/internal/functional/hash.hpp

    r0e5e8bf9 r8f8f1d1e  
    3030#define LIBCPP_INTERNAL_FUNCTIONAL_HASH
    3131
     32#include <cstdlib>
     33
    3234namespace std
    3335{
     36    template<class>
     37    struct is_arithmetic;
     38
     39    template<class>
     40    struct is_pointer;
     41
    3442    /**
    3543     * 20.9.13, hash function primary template:
     
    6472        size_t hash(T x) noexcept
    6573        {
    66             static_assert(is_arithmetic_v<T> || is_pointer_v<T>,
     74            static_assert(is_arithmetic<T>::value || is_pointer<T>::value,
    6775                          "invalid type passed to aux::hash");
    6876
  • uspace/lib/cpp/include/internal/functional/invoke.hpp

    r0e5e8bf9 r8f8f1d1e  
    3232#include <internal/utility/declval.hpp>
    3333#include <internal/utility/forward_move.hpp>
    34 #include <type_traits>
     34
     35namespace std
     36{
     37    template<class>
     38    struct is_member_function_pointer;
     39
     40    template<class, class>
     41    struct is_base_of;
     42
     43    template<class>
     44    struct is_member_object_pointer;
     45}
    3546
    3647namespace std::aux
     
    4354    decltype(auto) invoke(R T::* f, T1&& t1, Ts&&... args)
    4455    {
    45         if constexpr (is_member_function_pointer_v<decltype(f)>)
     56        if constexpr (is_member_function_pointer<decltype(f)>::value)
    4657        {
    47             if constexpr (is_base_of_v<T, remove_reference_t<T1>>)
     58            if constexpr (is_base_of<T, remove_reference_t<T1>>::value)
    4859                // (1.1)
    4960                return (t1.*f)(forward<Ts>(args)...);
     
    5263                return ((*t1).*f)(forward<Ts>(args)...);
    5364        }
    54         else if constexpr (is_member_object_pointer_v<decltype(f)> && sizeof...(args) == 0)
     65        else if constexpr (is_member_object_pointer<decltype(f)>::value && sizeof...(args) == 0)
    5566        {
    5667            /**
     
    5869             *       so we need sizeof...(args) to be 0.
    5970             */
    60             if constexpr (is_base_of_v<T, remove_reference_t<T1>>)
     71            if constexpr (is_base_of<T, remove_reference_t<T1>>::value)
    6172                // (1.3)
    6273                return t1.*f;
     
    7384         *       so we use this because we know it is false here.
    7485         */
    75         static_assert(is_member_function_pointer_v<decltype(f)>, "invalid invoke");
     86        static_assert(is_member_function_pointer<decltype(f)>::value, "invalid invoke");
    7687    }
    7788
Note: See TracChangeset for help on using the changeset viewer.