Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/libcxx/numerics/numeric.ops/midpoint.integer.pass.cpp
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// UNSUPPORTED: c++03, c++11, c++14, c++17 | // UNSUPPORTED: c++03, c++11, c++14, c++17 | ||||
// <numeric> | // <numeric> | ||||
// template <class _Tp> | // template <class _Tp> | ||||
// _Tp midpoint(_Tp __a, _Tp __b) noexcept | // _Tp midpoint(_Tp __a, _Tp __b) noexcept | ||||
// | // | ||||
#include <numeric> | |||||
#include <cassert> | #include <cassert> | ||||
#include <cstddef> | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <numeric> | |||||
#include "test_macros.h" | #include "test_macros.h" | ||||
// Users are not supposed to provide template argument lists for | // Users are not supposed to provide template argument lists for | ||||
// functions in the standard library (there's an exception for min and max) | // functions in the standard library (there's an exception for min and max) | ||||
// However, libc++ protects against this for pointers, so we check to make | // However, libc++ protects against this for pointers, so we check to make | ||||
// sure that our protection is working here. | // sure that our protection is working here. | ||||
// In some cases midpoint<int>(0,0) might get deduced as the pointer overload. | // In some cases midpoint<int>(0,0) might get deduced as the pointer overload. | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |