format: avoid cast warnings for exception constructor

This commit is contained in:
Danny Robson 2016-04-28 16:07:49 +10:00
parent efa52c60e9
commit 27800de3a0

View File

@ -153,6 +153,8 @@ namespace util {
{ {
CHECK (first <= last); CHECK (first <= last);
using namespace std::literals;
static const char DELIMITER = '%'; static const char DELIMITER = '%';
auto cursor = std::find (first, last, DELIMITER); auto cursor = std::find (first, last, DELIMITER);
std::copy (first, cursor, std::ostream_iterator<char> (dest)); std::copy (first, cursor, std::ostream_iterator<char> (dest));
@ -162,7 +164,7 @@ namespace util {
auto spec = cursor + 1; auto spec = cursor + 1;
if (spec == last) if (spec == last)
throw util::format::format_error ("missing format specifier"); throw util::format::format_error ("missing format specifier"s);
if (!is_valid_specifier<typename std::decay<ValueT>::type> (&*spec)) if (!is_valid_specifier<typename std::decay<ValueT>::type> (&*spec))
throw util::format::invalid_specifier<ValueT> (*spec); throw util::format::invalid_specifier<ValueT> (*spec);