Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarLexicalCast.cpp
blob: 1387b2e401edc4bcd8c9cafe2851689e9740f6a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "StarLexicalCast.hpp"

namespace Star {

void throwLexicalCastError(std::errc ec, const char* first, const char* last) {
  StringView str(first, last - first);
  if (ec == std::errc::invalid_argument)
    throw BadLexicalCast(strf("Lexical cast failed on '{}' (invalid argument)", str));
  else
    throw BadLexicalCast(strf("Lexical cast failed on '{}'", str));
}

}