Skip to content

Commit 7db6b4a

Browse files
committed
Fixed errors with Rice 4.9
1 parent 6c9a769 commit 7db6b4a

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.16.3 (unreleased)
2+
3+
- Fixed errors with Rice 4.9
4+
15
## 0.16.2 (2026-01-02)
26

37
- Fixed error with Rice 4.8

ext/or-tools/linear.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,21 @@ void init_linear(Rice::Module& m) {
172172
.define_singleton_function(
173173
"_new",
174174
[](const std::string& name, MPSolver::OptimizationProblemType problem_type) {
175-
std::unique_ptr<MPSolver> solver(new MPSolver(name, problem_type));
175+
MPSolver* solver = new MPSolver(name, problem_type);
176176
if (!solver) {
177177
throw std::runtime_error("Unrecognized solver type");
178178
}
179179
return solver;
180-
})
180+
}, Rice::Return().takeOwnership())
181181
.define_singleton_function(
182182
"_create",
183183
[](const std::string& solver_id) {
184-
std::unique_ptr<MPSolver> solver(MPSolver::CreateSolver(solver_id));
184+
MPSolver* solver = MPSolver::CreateSolver(solver_id);
185185
if (!solver) {
186186
throw std::runtime_error("Unrecognized solver type");
187187
}
188188
return solver;
189-
})
189+
}, Rice::Return().takeOwnership())
190190
.define_method(
191191
"time_limit=",
192192
[](MPSolver& self, double time_limit) {

0 commit comments

Comments
 (0)