[libcxx-commits] [PATCH] D116944: [libc++] Split a few utilities out of __threading_support
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jan 14 07:29:02 PST 2022
ldionne accepted this revision as: libc++.
ldionne added inline comments.
This revision is now accepted and ready to land.
================
Comment at: libcxx/include/__chrono/convert_to_timespec.h:26
+// Convert a nanoseconds duration to the given TimeSpec type, which must have
+// the same properties as std::timespec.
+template <class _TimeSpec>
----------------
Quuxplusone wrote:
> In fact `__libcpp_timespec_t` is unconditionally a typedef for `::timespec`; so could we just use `::timespec` here?
> The template solution isn't too bad, but it still seems like it's working around a problem that shouldn't have been a problem in the first place.
As I said in the commit message:
> Concretely, we never seem to use it with anything other than `::timespec`, but I am wary of hardcoding that assumption as part of this change, since I suspect there's a reason for going through these hoops in the first place.
I can refactor that in a subsequent patch so that any fallout is separate from this one.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116944/new/
https://reviews.llvm.org/D116944
More information about the libcxx-commits
mailing list