Still more Constexpr fun (n3469)

Marshall Clow mclow.lists at gmail.com
Wed Jul 31 12:34:48 PDT 2013


On Jul 31, 2013, at 11:37 AM, Howard Hinnant <hhinnant at apple.com> wrote:
> On Jul 29, 2013, at 1:12 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
> 
>> Slouching towards C++14
>> Adding constexpr to <chrono>
>> 
> 
> Thanks Marshall!
> 
> I can't find anything to complain about.  Please commit.  Could I ask a favor?
> 
> Could you do a drive-by fix for:
> 
>    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration() {} // = default;
> 
> to implement the required = default if _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS  is not defined?
> 
> We have an example in <memory> for one way to do this:
> 
> template <class _Tp>
> struct _LIBCPP_TYPE_VIS default_delete
> {
> #ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
>    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
> #else
>    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
> #endif

Done in revision 187517.
Thanks for the review!


-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki





More information about the cfe-commits mailing list