Skip to content

Commit

Permalink
Replace constexpr generic_strtod with inline const
Browse files Browse the repository at this point in the history
clang-ci >= 13.0 is failing to compile a constexpr function pointer
assignment.  This is possibly due to strtof (and family) not being
implemented as constexpr in the relevant libc++.

Closes 136
Closes 156

Signed-off-by: Sean Robinson <[email protected]>
  • Loading branch information
skrobinson committed Aug 11, 2022
1 parent d8c10a9 commit dbdacc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@ template <class T> struct parse_number<T> {

namespace {

template <class T> constexpr auto generic_strtod = nullptr;
template <> constexpr auto generic_strtod<float> = strtof;
template <> constexpr auto generic_strtod<double> = strtod;
template <> constexpr auto generic_strtod<long double> = strtold;
template <class T> inline const auto generic_strtod = nullptr;
template <> inline const auto generic_strtod<float> = strtof;
template <> inline const auto generic_strtod<double> = strtod;
template <> inline const auto generic_strtod<long double> = strtold;

} // namespace

Expand Down

0 comments on commit dbdacc2

Please sign in to comment.