FTXUI 7.0.3
C++ functional terminal UI.
Loading...
Searching...
No Matches
ref.cpp
Go to the documentation of this file.
1// Copyright 2026 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#include "ftxui/util/ref.hpp"
5
6#include <utility>
7
8namespace ftxui {
9
10namespace {
11
12// StringRef, ConstStringRef, and ConstStringListRef are exported
13// (FTXUI_EXPORT(SCREEN)), but all of their member functions -- including
14// ones inherited from Ref<string>/ConstRef<string> -- are defined inline in
15// the header and never odr-used from within libftxui-screen itself. On
16// Windows, MSVC only emits (and therefore dllexports) an inline member
17// function into the DLL that first odr-uses it; otherwise consumers linking
18// against the dllimport declaration get an unresolved external symbol. This
19// function exists solely to force that instantiation.
20[[maybe_unused]] void ForceSymbolInstantiation() {
21 StringRef s = "a";
22 StringRef s2(s);
23 StringRef s3(std::move(s2));
24 s = s3;
25 s = std::move(s3);
26 (void)s();
27 (void)*s;
28 (void)s.operator->();
29
30 ConstStringRef c = "a";
31 ConstStringRef c2(c);
32 ConstStringRef c3(std::move(c2));
33 c = c3;
34 c = std::move(c3);
35 (void)c();
36 (void)*c;
37
38 ConstStringListRef l;
39 ConstStringListRef l2(l);
40 ConstStringListRef l3(std::move(l2));
41 l = l3;
42 l = std::move(l3);
43 (void)l.size();
44 (void)l[0];
45}
46
47} // namespace
48
49} // namespace ftxui
The FTXUI ftxui:: namespace.
Definition animation.hpp:11