Skip to content

Commit

Permalink
bel_c class : constexpr指定にマクロを使っていなかたのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yumetodo committed Mar 22, 2016
1 parent e766a2b commit 8df8eaf
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions dxlibex/basic_types/bel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace dxle {
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr common_type_t<bel_c<T1, Period1>, bel_c<T2, Period2 >>
DXLE_CONSTEXPR common_type_t<bel_c<T1, Period1>, bel_c<T2, Period2 >>
operator+(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
typedef bel_c<T1, Period1> bel_c1;
Expand All @@ -174,7 +174,7 @@ namespace dxle {
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr common_type_t<bel_c<T1, Period1>, bel_c<T2, Period2>>
DXLE_CONSTEXPR common_type_t<bel_c<T1, Period1>, bel_c<T2, Period2>>
operator-(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
typedef bel_c<T1, Period1> bel_c1;
Expand All @@ -193,30 +193,30 @@ namespace dxle {
}

template<typename T1, typename _Period, typename T2>
constexpr bel_c<detail::common_rep_type_t<T1, T2>, _Period>
DXLE_CONSTEXPR bel_c<detail::common_rep_type_t<T1, T2>, _Period>
operator*(const bel_c<T1, _Period>& b, const T2& r)
{
typedef bel_c<common_type_t<T1, T2>, _Period> result_t;
return result_t(result_t(b).count() * r);
}

template<typename T1, typename T2, typename _Period>
constexpr bel_c<detail::common_rep_type_t<T2, T1>, _Period>
DXLE_CONSTEXPR bel_c<detail::common_rep_type_t<T2, T1>, _Period>
operator*(const T1& r, const bel_c<T2, _Period>& b)
{
return b * r;
}

template<typename T1, typename _Period, typename T2>
constexpr bel_c<detail::common_rep_type_t<T1, enable_if_t<!is_bel_c<T2>::value, T2>>, _Period>
DXLE_CONSTEXPR bel_c<detail::common_rep_type_t<T1, enable_if_t<!is_bel_c<T2>::value, T2>>, _Period>
operator/(const bel_c<T1, _Period>& b, const T2& r)
{
typedef bel_c<common_type_t<T1, T2>, _Period> result_t;
return result_t(result_t(b).count() / r);
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr common_type_t<T1, T2>
DXLE_CONSTEXPR common_type_t<T1, T2>
operator/(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
typedef bel_c<T1, Period1> bel_c1;
Expand All @@ -227,15 +227,15 @@ namespace dxle {

// DR 934.
template<typename T1, typename _Period, typename T2>
constexpr bel_c<detail::common_rep_type_t<T1, enable_if_t<!is_bel_c<T2>::value, T2>>, _Period>
DXLE_CONSTEXPR bel_c<detail::common_rep_type_t<T1, enable_if_t<!is_bel_c<T2>::value, T2>>, _Period>
operator%(const bel_c<T1, _Period>& b, const T2& r)
{
typedef bel_c<common_type_t<T1, T2>, _Period> result_t;
return result_t(result_t(b).count() % r);
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr common_type_t<bel_c<T1, Period1>, bel_c<T2, Period2>>
DXLE_CONSTEXPR common_type_t<bel_c<T1, Period1>, bel_c<T2, Period2>>
operator%(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
typedef bel_c<T1, Period1> bel_c1;
Expand All @@ -246,7 +246,7 @@ namespace dxle {

// comparisons
template<typename T1, typename Period1, typename T2, typename Period2>
constexpr bool operator==(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
DXLE_CONSTEXPR bool operator==(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
typedef bel_c<T1, Period1> bel_c1;
typedef bel_c<T2, Period2> bel_c2;
Expand All @@ -255,7 +255,7 @@ namespace dxle {
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr bool operator<(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
DXLE_CONSTEXPR bool operator<(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
typedef bel_c<T1, Period1> bel_c1;
typedef bel_c<T2, Period2> bel_c2;
Expand All @@ -264,25 +264,25 @@ namespace dxle {
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr bool operator!=(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
DXLE_CONSTEXPR bool operator!=(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
return !(l == r);
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr bool operator<=(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
DXLE_CONSTEXPR bool operator<=(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
return !(r < l);
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr bool operator>(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
DXLE_CONSTEXPR bool operator>(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
return r < l;
}

template<typename T1, typename Period1, typename T2, typename Period2>
constexpr bool operator>=(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
DXLE_CONSTEXPR bool operator>=(const bel_c<T1, Period1>& l, const bel_c<T2, Period2>& r)
{
return !(l < r);
}
Expand Down

1 comment on commit 8df8eaf

@yumetodo
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#51

Please sign in to comment.