[libcxx] r185181 - Dimitry Andric: Add const to constexpr member functions in order to cope with new C++1y language rules. This silences -Wconstexpr-not-const warnings.
Howard Hinnant
hhinnant at apple.com
Fri Jun 28 11:09:36 PDT 2013
Author: hhinnant
Date: Fri Jun 28 13:09:35 2013
New Revision: 185181
URL: http://llvm.org/viewvc/llvm-project?rev=185181&view=rev
Log:
Dimitry Andric: Add const to constexpr member functions in order to cope with new C++1y language rules. This silences -Wconstexpr-not-const warnings.
Modified:
libcxx/trunk/include/chrono
Modified: libcxx/trunk/include/chrono
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/chrono?rev=185181&r1=185180&r2=185181&view=diff
==============================================================================
--- libcxx/trunk/include/chrono (original)
+++ libcxx/trunk/include/chrono Fri Jun 28 13:09:35 2013
@@ -468,7 +468,7 @@ template <class _LhsDuration, class _Rhs
struct __duration_eq
{
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs)
+ bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const
{
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
return _Ct(__lhs).count() == _Ct(__rhs).count();
@@ -479,7 +479,7 @@ template <class _LhsDuration>
struct __duration_eq<_LhsDuration, _LhsDuration>
{
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs)
+ bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const
{return __lhs.count() == __rhs.count();}
};
@@ -509,7 +509,7 @@ template <class _LhsDuration, class _Rhs
struct __duration_lt
{
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs)
+ bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const
{
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
return _Ct(__lhs).count() < _Ct(__rhs).count();
@@ -520,7 +520,7 @@ template <class _LhsDuration>
struct __duration_lt<_LhsDuration, _LhsDuration>
{
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
- bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs)
+ bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const
{return __lhs.count() < __rhs.count();}
};
More information about the cfe-commits
mailing list