blob: 7bd6d2299b49f6b300fc74f035c7d9aa77bbb0d5 [file] [log] [blame]
// Copyright 2023 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include <type_traits>
void SendableCompileTimeTests() {
// Test that |std::is_invocable| can figure out move-only type requirements.
// |async_patterns::BindForSending| relies on this kind of check so we should
// make sure it works. See `sendable.h` for details.
auto move_only_sink = [](std::unique_ptr<int>) {};
static_assert(std::is_invocable_v<decltype(move_only_sink), std::unique_ptr<int>>);
static_assert(!std::is_invocable_v<decltype(move_only_sink), std::unique_ptr<int>&>);
}