• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/core/functional/include/hpx/functional/detail/empty_function.hpp
1
//  Copyright (c) 2011 Thomas Heller
2
//  Copyright (c) 2013-2025 Hartmut Kaiser
3
//  Copyright (c) 2014-2019 Agustin Berge
4
//
5
//  SPDX-License-Identifier: BSL-1.0
6
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
7
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8

9
#pragma once
10

11
#include <hpx/config.hpp>
12
#include <hpx/functional/detail/vtable/vtable.hpp>
13

14
namespace hpx::util::detail {
15

16
    ///////////////////////////////////////////////////////////////////////////
17
    struct empty_function
18
    {
19
    };    // must be trivial and empty
20

21
    [[noreturn]] HPX_CORE_EXPORT void throw_bad_function_call();
22

23
    template <typename R>
24
    [[noreturn]] inline R throw_bad_function_call()
25
    {
26
        throw_bad_function_call();
×
27
    }
28

29
    ///////////////////////////////////////////////////////////////////////////
30
    // make sure the empty table instance is initialized in time, even
31
    // during early startup
32
    HPX_CXX_EXPORT template <typename Sig, bool Copyable>
33
    struct function_vtable;
34

35
    // NOTE: nvcc (at least CUDA 9.2 and 10.1) fails with an internal compiler
36
    // error ("there was an error in verifying the lgenfe output!") with this
37
    // enabled, so we explicitly use the fallback.
38
#if !defined(HPX_HAVE_CUDA)
39
    template <typename Sig>
40
    [[nodiscard]] constexpr function_vtable<Sig, true> const*
41
    get_empty_function_vtable() noexcept
42
    {
43
        return &vtables<function_vtable<Sig, true>, empty_function>::instance;
44
    }
45
#else
46
    template <typename Sig>
47
    [[nodiscard]] function_vtable<Sig, true> const*
48
    get_empty_function_vtable() noexcept
49
    {
50
        static function_vtable<Sig, true> const empty_vtable =
51
            function_vtable<Sig, true>(
52
                detail::construct_vtable<empty_function>());
53
        return &empty_vtable;
54
    }
55
#endif
56
}    // namespace hpx::util::detail
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc