【发布时间】:2017-05-27 05:32:19
【问题描述】:
我正在 C++ 中为参数化字符串(用于指定终端的某些终端功能)实现解析器。然后我在 terminfo 的手册页上看到了这个:
%? expr %t thenpart %e elsepart %;
This forms an if-then-else. The %e elsepart is optional. Usually the %? expr part pushes
a value onto the stack, and %t pops it from the stack, testing if it is nonzero (true). If
it is zero (false), control passes to the %e (else) part.
所以,我的问题是:
正如man page所说,字符串中的expr部分可以通常将值压入堆栈,那么expr部分还可以做什么,也就是还有什么其他操作可以在 expr 部分执行,除了将值压入堆栈?
【问题讨论】:
标签: terminal c++14 terminfo termcap