This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Define std::gcd and std::lcm for C++17


This shares the code for std::gcd and std::experimental::gcd, and
similarly for lcm.

I realised I'd mixed up the gcd.cc and lcm.cc tests so this patch also
swaps them around.

	* doc/xml/manual/status_cxx2017.xml: Update gcd/lcm status.
	* doc/html/*: Regenerate.
	* include/experimental/numeric (__abs): Move to <numeric>.
	(gcd, lcm): Use __detail::gcd and __detail::lcm.
	* include/std/numeric (__detail::__abs_integral)
	(__detail::__gcd, __detail::__lcm): Define.
	(gcd, lcm): Define for C++17.
	* testsuite/26_numerics/gcd/1.cc: New test.
	* testsuite/26_numerics/lcm/1.cc: New test.
	* testsuite/experimental/numeric/gcd.cc: Swap contents with ...
	* testsuite/experimental/numeric/lcd.cc: ... this.

Tested powerpc64le-linux, committed to trunk.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]