brintos

brintos / llvm-project-archived public Read only

0
0
Text · 954 B · 73f6c44 Raw
26 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++17, c++2011 12// checks that CTAD for std::packaged_task works properly with static operator() overloads13 14#include <future>15#include <type_traits>16 17struct Except {18  static int operator()(int*, long*) { return 0; }19};20static_assert(std::is_same_v<decltype(std::packaged_task{Except{}}), std::packaged_task<int(int*, long*)>>);21 22struct Noexcept {23  static int operator()(int*, long*) noexcept { return 0; }24};25static_assert(std::is_same_v<decltype(std::packaged_task{Noexcept{}}), std::packaged_task<int(int*, long*)>>);26