Skip to content

Commit c9ca524

Browse files
committed
some minor updates
1 parent 318c1b8 commit c9ca524

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Sources.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ target_sources(Luau.VM PRIVATE
352352
VM/include/luaconf.h
353353
VM/include/lualib.h
354354
VM/include/llsl.h
355+
VM/include/llfluent_builder.h
355356

356357
VM/src/ares.cpp
357358
VM/src/lapi.cpp
@@ -430,7 +431,6 @@ target_sources(Luau.VM PRIVATE
430431
VM/src/llprim.h
431432
VM/src/llprim_set_primitive_params.inl
432433
VM/src/llfluent_builder.cpp
433-
VM/include/llfluent_builder.h
434434
VM/src/lyieldable.cpp
435435
VM/src/lstrbuf.cpp
436436
VM/src/lyieldstrlib.h

VM/include/llfluent_builder.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ typedef int (*lua_CFunction)(lua_State* L);
77
// Default link target: apply to the prim running the script.
88
static const int SLUA_LINK_THIS = -4;
99

10+
// A note about C++20 porting.
11+
// The const char* name fields in the descriptors must have static storage duration
12+
// (e.g. string literals).
13+
// This is not enforced at compile time,
14+
// but when moving to C++20 we can do something like the following:
15+
//
16+
// struct LiteralString
17+
// {
18+
// consteval LiteralString(const char* p) noexcept : ptr(p) {}
19+
// operator const char*() const noexcept { return ptr; }
20+
// const char* ptr;
21+
// };
22+
// The consteval constructor ensures that only string literals can be used
23+
// to construct a LiteralString.
24+
1025
struct FluentParamDescriptor
1126
{
1227
const char* name; // effective property name (pretty alias or strict fallback)

0 commit comments

Comments
 (0)