c++20 introduces std::midpoint:
template< class T >
constexpr T midpoint( T a, T b ) noexcept;
template< class T >
constexpr T* midpoint( T* a, T* b );
Both gcc and clang make it noexcept
though.
c++20 introduces std::midpoint:
template< class T >
constexpr T midpoint( T a, T b ) noexcept;
template< class T >
constexpr T* midpoint( T* a, T* b );
Both gcc and clang make it noexcept
though.