Changeset 72d9e44 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:17Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3276682
Parents:
9dfdb03
git-author:
Jaroslav Jindrak <dzejrou@…> (2017-10-13 10:37:28)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:17)
Message:

cpp: implemented std::integral_constant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/type_traits

    r9dfdb03 r72d9e44  
    3636
    3737    template<class T, T v>
    38     struct integral_constant;
     38    struct integral_constant
     39    {
     40        static constexpr T value = v;
     41
     42        using value_type = T;
     43        using type       = integral_constant<T, v>;
     44
     45        constexpr operator value_type() const noexcept
     46        {
     47            return value;
     48        }
     49
     50        constexpr value_type operator()() const noexcept
     51        {
     52            return value;
     53        }
     54    }
    3955
    4056    using true_type = integral_constant<bool, true>;
Note: See TracChangeset for help on using the changeset viewer.