Skip to content

Commit

Permalink
Fix compilation with intel compilers (ICC/ICPC) v14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Fraux authored and vitaut committed Sep 27, 2018
1 parent 4cf21f5 commit e864acf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
# endif
#endif

#if FMT_HAS_FEATURE(cxx_explicit_conversions) || FMT_MSC_VER >= 1800
#if FMT_HAS_FEATURE(cxx_explicit_conversions) || \
FMT_GCC_VERSION >= 405 || FMT_MSC_VER >= 1800
# define FMT_EXPLICIT explicit
#else
# define FMT_EXPLICIT
Expand Down
3 changes: 2 additions & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,8 @@ FMT_CONSTEXPR void parse_format_string(
}
Handler &handler_;
} write{handler};
auto begin = format_str.data(), end = begin + format_str.size();
auto begin = format_str.data();
auto end = begin + format_str.size();
while (begin != end) {
// Doing two passes with memchr (one for '{' and another for '}') is up to
// 2.5x faster than the naive one-pass implementation on big format strings.
Expand Down
2 changes: 1 addition & 1 deletion test/format-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ struct explicitly_convertible_to_string_like {
typename String,
typename = typename std::enable_if<
std::is_constructible<String, const char*, std::size_t>::value>::type>
explicit operator String() const { return String("foo", 3u); }
FMT_EXPLICIT operator String() const { return String("foo", 3u); }
};

TEST(FormatterTest, FormatExplicitlyConvertibleToStringLike) {
Expand Down

0 comments on commit e864acf

Please sign in to comment.