Skip to content

Commit 2dca624

Browse files
committed
lp_data: Fix compilation (#4662)
1 parent 33c22be commit 2dca624

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ortools/lp_data/lp_parser.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,17 @@ bool LPParser::ParseConstraint(StringPiece constraint) {
237237

238238
namespace {
239239

240+
template<class>
241+
constexpr bool dependent_false = false; // workaround before CWG2518/P2593R1
242+
240243
template <typename T>
241244
bool SimpleAtoFractional(absl::string_view str, T* value) {
242245
if constexpr (std::is_same_v<T, double>) {
243246
return absl::SimpleAtod(str, value);
244247
} else if constexpr (std::is_same_v<T, float>) {
245248
return absl::SimpleAtof(str, value);
246249
} else {
247-
static_assert(false, "Unsupported fractional type");
250+
static_assert(dependent_false<T>, "Unsupported fractional type");
248251
return false;
249252
}
250253
}

0 commit comments

Comments
 (0)