Ignore:
Timestamp:
2018-07-05T21:41:24Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
08c1df0
Parents:
bfc972e
git-author:
Dzejrou <dzejrou@…> (2018-05-16 17:20:04)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:24)
Message:

cpp: aux::value_is is now an alias to integral_constant for compatibility, added naive implementations of the last two typetraits make_signed and make_unsigned

File:
1 edited

Legend:

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

    rbfc972e rca8d393  
    3030#define LIBCPP_AUX
    3131
     32namespace std
     33{
     34    /**
     35     * 20.10.3, helper class:
     36     */
     37
     38    template<class T, T v>
     39    struct integral_constant
     40    {
     41        static constexpr T value = v;
     42
     43        using value_type = T;
     44        using type       = integral_constant<T, v>;
     45
     46        constexpr operator value_type() const noexcept
     47        {
     48            return value;
     49        }
     50
     51        constexpr value_type operator()() const noexcept
     52        {
     53            return value;
     54        }
     55    };
     56
     57    using true_type = integral_constant<bool, true>;
     58    using false_type = integral_constant<bool, false>;
     59}
     60
    3261namespace std::aux
    3362{
     
    5584    };
    5685
     86    // For compatibility with integral_constant.
    5787    template<class T, T v>
    58     struct value_is
    59     {
    60         static constexpr T value = v;
    61     };
     88    using value_is = std::integral_constant<T, v>;
    6289}
    6390
Note: See TracChangeset for help on using the changeset viewer.