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, y ConstStringListRef se exportan
13// (FTXUI_EXPORT(SCREEN)), pero todas sus funciones miembro -- incluyendo
14// las heredadas de Ref<string>/ConstRef<string> -- se definen en línea en
15// el encabezado y nunca se usan (odr-used) dentro de libftxui-screen. En
16// Windows, MSVC solo emite (y por lo tanto exporta con dllexport) una función
17// miembro en línea hacia la DLL que la usa (odr-use) por primera vez; de lo
18// contrario, los consumidores que enlazan contra la declaración dllimport
19// obtienen un símbolo externo no resuelto. Esta función existe únicamente
20// para forzar esa instanciación.
21[[maybe_unused]] void ForceSymbolInstantiation() {
22 StringRef s = "a";
23 StringRef s2(s);
24 StringRef s3(std::move(s2));
25 s = s3;
26 s = std::move(s3);
27 (void)s();
28 (void)*s;
29 (void)s.operator->();
30
31 ConstStringRef c = "a";
32 ConstStringRef c2(c);
33 ConstStringRef c3(std::move(c2));
34 c = c3;
35 c = std::move(c3);
36 (void)c();
37 (void)*c;
38
39 ConstStringListRef l;
40 ConstStringListRef l2(l);
41 ConstStringListRef l3(std::move(l2));
42 l = l3;
43 l = std::move(l3);
44 (void)l.size();
45 (void)l[0];
46}
47
48} // namespace
49
50} // namespace ftxui
El espacio de nombres ftxui:: de FTXUI.
Definition animation.hpp:11