brintos

brintos / llvm-project-archived public Read only

0
0
Text · 917 B · 2aef4af Raw
33 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// UNSUPPORTED: no-threads10// UNSUPPORTED: c++03, c++11, c++14, c++1711 12// explicit stop_source(nostopstate_t) noexcept;13 14#include <cassert>15#include <stop_token>16#include <type_traits>17 18#include "test_macros.h"19 20static_assert(std::is_nothrow_constructible_v<std::stop_source, std::nostopstate_t>);21// explicit22static_assert(!std::is_convertible_v<std::nostopstate_t, std::stop_source>);23 24int main(int, char**) {25  {26    std::stop_source ss(std::nostopstate);27    assert(!ss.stop_possible());28    assert(!ss.stop_requested());29  }30 31  return 0;32}33