Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko closed this revision.
Eugene.Zelenko added a comment.
Committed in r276750.
https://reviews.llvm.org/D21343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.o
EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.
LGTM.
https://reviews.llvm.org/D21343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-
mclow.lists updated this revision to Diff 65463.
mclow.lists added a comment.
Updated with Eric's constexpr tests.
Once this is approved, it will be applied twice - once in
``, and once in ``
https://reviews.llvm.org/D21343
Files:
include/experimental/numeric
test/std/experimental/numeric/
mclow.lists marked 8 inline comments as done.
mclow.lists added a comment.
http://reviews.llvm.org/D21343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mclow.lists updated this revision to Diff 60856.
mclow.lists added a comment.
Updated based on comments here and elsewhere.
- Do the abs once, rather than at every level of recursion
- Add tests for `bool`.
- Constexpr
Also, add an assertion to detect overflow in `lcm`.
I have not yet incorpora
EricWF added a comment.
Gosh darn it Howard. Your like 10 minutes ahead of me.
Here is a constexpr gcd test.
https://gist.github.com/EricWF/46ea4489f405ec9f83325a278fe99535
Comment at: include/experimental/numeric:50
@@ +49,3 @@
+struct __abs<_Tp, true> {
+ _LIBCPP_INLINE
howard.hinnant added a comment.
Can't call `std::abs` as it isn't `constexpr`. You'll have to roll your own.
http://reviews.llvm.org/D21343
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c
EricWF added inline comments.
Comment at: include/experimental/numeric:44
@@ +43,3 @@
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
+
This should be `_LIBCPP_BEGIN_NAMESPACE_LFTS`.
Comment at: include/experimental/numeric:46
@@ +45,3 @@
+
+template ::v
howard.hinnant added a comment.
I created a top-level `gcd` which did nothing but make everything unsigned and
do the abs once, and then called a `__gcd` specialized for unsigned and only
one kind of unsigned, and got measurably faster results (about 10%).
template
constexpr
std::enable_i
mclow.lists created this revision.
mclow.lists added reviewers: EricWF, howard.hinnant.
mclow.lists added a subscriber: cfe-commits.
These are probably going to end up in C++17 as well.
This is a straight addition; no changes to existing code.
http://reviews.llvm.org/D21343
Files:
include/exp
10 matches
Mail list logo