aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libminimal/spanuser.h
blob: c78ba35e77c1ce020d3e8b8e884ebf82619f22d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#ifndef SPANUSER_H
#define SPANUSER_H

#include "libminimalmacros.h"

#if __cplusplus >= 202002L
#  include <span>

using IntSpan3 = std::span<int, 3>;
using IntSpan = std::span<int>;
using ConstIntSpan3 = std::span<const int, 3>;
#endif

struct LIBMINIMAL_API SpanUser
{
    SpanUser();

    static bool enabled();

#if __cplusplus >= 202002L
    static IntSpan3 getIntSpan3();
    static IntSpan getIntSpan();
    static ConstIntSpan3 getConstIntSpan3();
    static IntSpan3 getIntSpan3_OpaqueContainer();

    static int sumIntSpan3(IntSpan3 isp3);
    static int sumIntSpan(IntSpan isp);
    static int sumConstIntSpan3(ConstIntSpan3 ispc3);
#endif // C++ 20
};

#endif // SPANUSER_H