gcc/libstdc++-v3
Jonathan Wakely 243874426d Define midpoint and lerp functions for C++20 (P0811R3)
The implementation of midpoint used for integral types is due to Howard
Hinnant and avoids a branch for int and larger types (but not for chars
and shorts).

The midpoint and lerp functions for floating point types come straight
from the P0811R3 proposal, with no attempt at optimization.

	* include/c_compatibility/math.h [C++20] (lerp): Add using
	declaration.
	* include/c_global/cmath [C++20] (__cpp_lib_interpolate): Define.
	(__lerp): Define function template to implement lerp.
	(lerp(float, float, float), lerp(double, double, double))
	(lerp(long double, long double, long double)): Define for C++20.
	* include/std/numeric [C++20] (__cpp_lib_interpolate): Define.
	(midpoint(T, T), midpoint(T*, T*)): Define.
	* include/std::version [C++20] (__cpp_lib_interpolate): Define.
	* testsuite/26_numerics/lerp.cc: New test.
	* testsuite/26_numerics/midpoint/floating.cc: New test.
	* testsuite/26_numerics/midpoint/integral.cc: New test.
	* testsuite/26_numerics/midpoint/pointer.cc: New test.

From-SVN: r269398
2019-03-05 18:37:24 +00:00
..
config baseline_symbols.txt: Adjust. 2019-02-22 21:25:59 +00:00
doc PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
include Define midpoint and lerp functions for C++20 (P0811R3) 2019-03-05 18:37:24 +00:00
libsupc++ PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
po PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
python PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
scripts Update copyright years. 2019-01-01 13:31:55 +01:00
src PR libstdc++/89562 use binary mode for file I/O 2019-03-03 22:23:33 +00:00
testsuite Define midpoint and lerp functions for C++20 (P0811R3) 2019-03-05 18:37:24 +00:00
acinclude.m4 PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
aclocal.m4
ChangeLog Define midpoint and lerp functions for C++20 (P0811R3) 2019-03-05 18:37:24 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018 Update copyright years. 2019-01-01 13:31:55 +01:00
config.h.in Add std::timespec and std::timespec_get for C++17 2019-02-14 14:10:25 +00:00
configure PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
configure.ac PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
configure.host configure.host (abi_baseline_pair): Adjust for SPARC64/Linux. 2019-02-22 07:25:52 +00:00
crossconfig.m4 Add std::timespec and std::timespec_get for C++17 2019-02-14 14:10:25 +00:00
fragment.am
linkage.m4
Makefile.am Update copyright years. 2019-01-01 13:31:55 +01:00
Makefile.in PR libstdc++/89466 avoid slow xsltproc command in configure 2019-02-27 11:25:44 +00:00
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.