Core LibraryalphaAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

class libtmux-cxx latest

EntityId

A tmux object id, typed by what it names.

Source and package
Qualified name
libtmux::EntityId
Namespace
libtmux
Package
libtmux-cxx
Source
include/libtmux/entities.hpp
class libtmux::EntityId

Description#

tmux spells these $0, @1 and %2. The prefix says which kind it is, and nothing in the type did: six accessors returned std::string_view, so a window id compiled wherever a pane id belonged, and pane.id() == window.id() was a comparison that can never be true but always built.

The string is reached through value() rather than through a conversion. A conversion is what let the mix-up through in the first place: with one, every std::string_view parameter accepts any id again, and this would read as type safety while providing none.

Comparing an id to plain text still works, because that cannot confuse two kinds — pane.id() == "%0" asks something answerable. Comparing two ids of different kinds does not compile.

Type parameters

Members3#

Esc

Type to search.

Reference previewOpen reference