Make single character prompts more robust

This commit is contained in:
Andrzej Rybczak
2017-03-26 06:02:53 +02:00
parent 5d12c9d544
commit 035bc65bf9
4 changed files with 20 additions and 17 deletions

View File

@@ -132,9 +132,11 @@ const Type EoF = Special | 279;
/// @see Window::getString()
struct PromptAborted : std::exception
{
PromptAborted() { }
template <typename ArgT>
PromptAborted(ArgT &&prompt)
: m_prompt(std::forward<ArgT>(prompt)) { }
: m_prompt(std::forward<ArgT>(prompt)) { }
virtual const char *what() const noexcept override { return m_prompt.c_str(); }