Suffix for chrono literals

Howard Hinnant howard.hinnant at gmail.com
Wed Jul 24 13:13:15 PDT 2013


On Jul 23, 2013, at 11:56 AM, Marshall Clow <mclow.lists at gmail.com> wrote:

> On Jul 22, 2013, at 2:09 PM, Marshall Clow <mclow.lists at gmail.com> wrote:
> 
>> Implements the "s" suffix for chrono literals as called for in N3642 + tests.

Thanks Marshall!

Just a few nits:

   test/utilities/time/chrono.literals.pass.cpp

should be:

   test/utilities/time/time.duration/time.duration.literals/chrono.literals.pass.cpp

I've added a comment concerning the inline on namespace literals as we did for <string>.

I've added static_cast for each of the integral duration udl's along the lines of:

	constexpr chrono::hours operator"" h(unsigned long long __h)
	{
		return chrono::hours(static_cast<chrono::hours::rep>(__h));
	}

Patch enclosed for this.

Please commit with these changes.

Thanks,
Howard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chrono_literals.patch
Type: application/octet-stream
Size: 3595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130724/bed9b1d2/attachment.obj>


More information about the cfe-commits mailing list