Implement LCM and GCD for C++17. Same code as for Library Fundamentals TS.
llvm-svn: 276751
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 25e95ac..cf03d66 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -2431,7 +2431,7 @@
template<typename _Integral>
inline _LIBCPP_INLINE_VISIBILITY
_Integral
-__gcd(_Integral __x, _Integral __y)
+__algo_gcd(_Integral __x, _Integral __y)
{
do
{
@@ -2456,7 +2456,7 @@
_VSTD::swap_ranges(__first, __middle, __middle);
return __middle;
}
- const difference_type __g = _VSTD::__gcd(__m1, __m2);
+ const difference_type __g = _VSTD::__algo_gcd(__m1, __m2);
for (_RandomAccessIterator __p = __first + __g; __p != __first;)
{
value_type __t(_VSTD::move(*--__p));