diff --git a/dlib/graph_cuts/find_max_factor_graph_potts.h b/dlib/graph_cuts/find_max_factor_graph_potts.h index 3f7e6b744..cbf9de5f8 100644 --- a/dlib/graph_cuts/find_max_factor_graph_potts.h +++ b/dlib/graph_cuts/find_max_factor_graph_potts.h @@ -591,6 +591,7 @@ namespace dlib } } #endif + COMPILE_TIME_ASSERT(is_signed_type::value); min_cut mc; dlib::impl::potts_flow_graph pfg(prob); mc(pfg, prob.number_of_nodes(), prob.number_of_nodes()+1); @@ -615,6 +616,7 @@ namespace dlib // The edges and node's have to use the same type to represent factor weights! COMPILE_TIME_ASSERT((is_same_type::value == true)); + COMPILE_TIME_ASSERT(is_signed_type::value); #ifdef ENABLE_ASSERTS for (unsigned long i = 0; i < g.number_of_nodes(); ++i) diff --git a/dlib/graph_cuts/min_cut.h b/dlib/graph_cuts/min_cut.h index aa9ac6a14..c8d458fac 100644 --- a/dlib/graph_cuts/min_cut.h +++ b/dlib/graph_cuts/min_cut.h @@ -149,6 +149,8 @@ namespace dlib orphans.clear(); typedef typename flow_graph::edge_type edge_type; + COMPILE_TIME_ASSERT(is_signed_type::value); + typedef typename flow_graph::out_edge_iterator out_edge_iterator; typedef typename flow_graph::in_edge_iterator in_edge_iterator;