welder
0.1.0
Bindings for annotated C++ types, from C++26 reflection
Toggle main menu visibility
Loading...
Searching...
No Matches
lang.hpp
Go to the documentation of this file.
1
#pragma once
2
3
// welder is C++26-and-newer only and is built on P2996 reflection. On the one
4
// toolchain that implements it today, gcc-16, that means `-std=c++26 -freflection`,
5
// which together define __cpp_impl_reflection. We check the capability here — the
6
// first header any welder TU pulls in (via <welder/vocabulary.hpp>) — so a
7
// misconfigured target fails with this one clear message instead of a wall of
8
// syntax errors deeper in the machinery. welder deliberately does NOT force the C++
9
// standard onto your target from CMake (no INTERFACE cxx_std_26): the language level
10
// is your project's dial to set. (Broaden the macro check as other compilers land
11
// P2996.)
12
#if !defined(__cpp_impl_reflection)
13
# error "welder requires C++26 reflection. On gcc-16 build this target with " \
14
"`-std=c++26 -freflection` (set CMAKE_CXX_STANDARD to 26 or newer). " \
15
"See the welder \"Getting started\" guide."
16
#endif
17
28
29
namespace
welder::inline v0 {
30
42
enum class
lang
:
unsigned
char
{
43
py
,
44
lua
,
45
};
46
67
template
<
unsigned
char
Slot>
68
requires
(Slot < 16)
69
inline
constexpr
lang
user_lang
{
static_cast<
lang
>
(16 + Slot)};
70
71
}
// namespace welder
welder
Definition
annotations.hpp:18
welder::user_lang
constexpr lang user_lang
A user-defined language: the Slot-th identity from the mask's user range (bit 16 + Slot) — for bindin...
Definition
lang.hpp:69
welder::lang
lang
The target languages welder ships rods for — but not the whole value space.
Definition
lang.hpp:42
welder::lang::py
@ py
Python (via the pybind11 and nanobind backends).
Definition
lang.hpp:43
welder::lang::lua
@ lua
Lua (via the sol2 and LuaBridge3 backends).
Definition
lang.hpp:44
src
welder
lang.hpp
Generated by
1.17.0