Skip to content

Commit

Permalink
Remove const from the custom format signature for in fmt < 9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAce committed Nov 10, 2023
1 parent e0707d5 commit 44355aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/h5pp/details/h5ppFstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,13 @@ namespace h5pp::type::sfinae {
#if defined(H5PP_USE_FMT) && defined(FMT_FORMAT_H_) && defined(FMT_VERSION)
// Add a custom fmt::formatter for h5pp::fstr_t
#if FMT_VERSION >= 90000
template <size_t N> struct fmt::formatter<h5pp::fstr_t<N>>: formatter<string_view> {
template <size_t N> struct fmt::formatter<h5pp::fstr_t<N>>: formatter<std::string_view> {
auto format(const h5pp::fstr_t<N> &f, format_context& ctx) const{
return fmt::formatter<string_view>::format(f.c_str(), ctx);
}
};
#else
template <size_t N> struct fmt::formatter<h5pp::fstr_t<N>>: formatter<string_view> {
template <size_t N> struct fmt::formatter<h5pp::fstr_t<N>>: formatter<std::string_view> {
auto format(const h5pp::fstr_t<N> &f, format_context& ctx){
return fmt::formatter<string_view>::format(f.c_str(), ctx);
}
Expand Down
4 changes: 2 additions & 2 deletions include/h5pp/details/h5ppVstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,13 @@ namespace h5pp::type::sfinae {
#if defined(H5PP_USE_FMT) && defined(FMT_FORMAT_H_) && defined(FMT_VERSION)
// Add a custom fmt::formatter for h5pp::vstr_t
#if FMT_VERSION >= 90000
template <> struct fmt::formatter<const h5pp::vstr_t>: formatter<string_view> {
template <> struct fmt::formatter<h5pp::vstr_t>: formatter<std::string_view> {
auto format(const h5pp::vstr_t &s, format_context& ctx) const{
return fmt::formatter<string_view>::format(s.c_str(), ctx);
}
};
#else
template <> struct fmt::formatter<const h5pp::vstr_t>: formatter<string_view> {
template <> struct fmt::formatter<const h5pp::vstr_t>: formatter<std::string_view> {
auto format(const h5pp::vstr_t &s, format_context& ctx){
return fmt::formatter<string_view>::format(s.c_str(), ctx);
}
Expand Down

0 comments on commit 44355aa

Please sign in to comment.