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 et ConstStringListRef sont exportées
13// (FTXUI_EXPORT(SCREEN)), mais toutes leurs fonctions membres -- y compris
14// celles héritées de Ref<string>/ConstRef<string> -- sont définies en ligne
15// dans l'en-tête et ne sont jamais odr-used depuis libftxui-screen elle-même.
16// Sous Windows, MSVC n'émet (et donc n'exporte via dllexport) une fonction
17// membre en ligne dans la DLL que lorsqu'elle est odr-used pour la première
18// fois ; sinon, les consommateurs qui se lient à la déclaration dllimport
19// obtiennent un symbole externe non résolu. Cette fonction existe uniquement
20// pour forcer cette instanciation.
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
L'espace de noms FTXUI ftxui::
Definition animation.hpp:11