[libcxx-commits] [PATCH] D59659: Direction for a fix of PR 41130
Marshall Clow via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Mar 21 11:35:53 PDT 2019
mclow.lists created this revision.
mclow.lists added reviewers: EricWF, ldionne, howard.hinnant.
mclow.lists added a project: libc++.
Herald added a subscriber: christof.
This is NOT a final patch.
I'm looking for suggestions on how to improve it.
But .. it does solve the OP's problem, and introduces no new ones that I can find.
Changes that have to be made before this is landed:
- Naming; we obviously don't want `__Fooby`, `__Fooby2`, etc in our code base.
- Removing the old `__duration_divide_result` and `__duration_divide_result_imp` classes which are no longer used
- Looking at `operator *` which probably needs the same treatment.
- Do we want to grab `__has_common_type` and put it in `<type_traits>` where other parts of libc++ can use it?
The reason that this is so pernicious is that `common_type` will blow up on you in C++03, rather than just SFINAE-ing away. So, you'd better be sure that there is a common type before you ask.
Note that the approach in this patch fails for C++03 (for the cases in the bug report). I don't know how to fix that. But, this patch does NOT break any existing cases in C++03 (Which Howard's 'lightly tested" patch did).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10300 bytes
Desc: not available
More information about the libcxx-commits