Skip to content

Commit

Permalink
feat: fixed for c++17
Browse files Browse the repository at this point in the history
  • Loading branch information
igormcoelho committed Oct 18, 2023
1 parent 7fd357f commit c96b6f5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CC_GCC=g++
CC_CLANG=clang++
#CC=clang++
#CPPSTD=-std=c++20 # -fconcepts-diagnostics-depth=2 # -Wfatal-errors
CPPSTD=--std=c++17 -Wfatal-errors # TODO REMOVE # -Wfatal-errors
CPPSTD=--std=c++17 # TODO REMOVE # -Wfatal-errors

##########################################
# SUBMODULE LOCATION
Expand Down
11 changes: 9 additions & 2 deletions optframe/optframe_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,11 @@ optframe_api1d_create_initial_search(FakeEnginePtr _engine, int ev_idx, int c_id
//
std::shared_ptr<MyConstructive> initial;
engine->loader.factory.assign(initial, c_idx, "OptFrame:Constructive");
assert(initial);
if(!initial) {
std::cout << "ERROR: failed to assign component '" << MyConstructive::idComponent()
<< "' as 'OptFrame:Constructive'" << std::endl;
assert(initial);
}
//
sref<optframe::InitialSearch<FCoreLibESolution>> initSol{
new optframe::BasicInitialSearch<FCoreLibESolution>(initial, single_ev)
Expand All @@ -1879,8 +1883,11 @@ optframe_api0d_get_evaluator(FakeEnginePtr _engine, int idx_ev)
std::shared_ptr<optframe::GeneralEvaluator<FCoreLibESolution>> component;

engine->loader.factory.assign(component, idx_ev, "OptFrame:GeneralEvaluator");
if (!component)
if (!component) {
std::cout << "ERROR: failed to assign component '" << optframe::GeneralEvaluator<FCoreLibESolution>::idComponent()
<< "' as 'OptFrame:GeneralEvaluator'" << std::endl;
assert(false);
}
void* ptr = component.get();
return ptr;
}
Expand Down

0 comments on commit c96b6f5

Please sign in to comment.