Skip to content

Commit 6a9eac8

Browse files
authored
Merge pull request #39 from modriplanetdoo/fix-throw
remove incorrect throw() function specification
2 parents d0dd8d4 + 90725e6 commit 6a9eac8

11 files changed

Lines changed: 12 additions & 22 deletions

File tree

mapmap/header/costs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class ModeNotSupportedException : public std::exception
132132
ModeNotSupportedException(const std::string& err_msg);
133133
~ModeNotSupportedException();
134134

135-
const char* what() const throw();
135+
const char* what() const noexcept;
136136

137137
protected:
138138
std::string m_err_msg;

mapmap/header/dynamic_programming.h

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class CombinatorialDynamicProgramming :
7878
~CombinatorialDynamicProgramming();
7979

8080
_s_t<COSTTYPE, SIMDWIDTH> optimize(
81-
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution) throw();
81+
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution);
8282

8383
protected:
8484
void discover_leaves();

mapmap/header/graph.h

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Graph
4040
~Graph();
4141

4242
void add_edge(const luint_t node_a, const luint_t node_b,
43-
const scalar_t<COSTTYPE> weight) throw();
43+
const scalar_t<COSTTYPE> weight);
4444
const std::vector<GraphNode>& nodes() const;
4545
const luint_t num_nodes() const;
4646
const std::vector<luint_t>& inc_edges(const luint_t node) const;

mapmap/header/mapmap.h

100755100644
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ class mapMAP
6666
~mapMAP();
6767

6868
/* set graph and label set */
69-
void set_graph(Graph<COSTTYPE> * graph) throw();
70-
void set_label_set(const LabelSet<COSTTYPE, SIMDWIDTH> * label_set)
71-
throw();
69+
void set_graph(Graph<COSTTYPE> * graph);
70+
void set_label_set(const LabelSet<COSTTYPE, SIMDWIDTH> * label_set);
7271

7372
/* alternatively - construct graph and label set */
7473
void add_edge(const luint_t node_a, const luint_t node_b,
75-
const _s_t<COSTTYPE, SIMDWIDTH> weight = 1.0) throw();
74+
const _s_t<COSTTYPE, SIMDWIDTH> weight = 1.0);
7675
void set_node_label_set(const luint_t node_id, const
77-
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& label_set) throw();
76+
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& label_set);
7877

7978
/* set MRF cost functions (compatibility mode) */
8079
void set_unaries(const UnaryCosts<COSTTYPE, SIMDWIDTH> * unaries);
@@ -100,11 +99,11 @@ class mapMAP
10099

101100
/* start optimization */
102101
_s_t<COSTTYPE, SIMDWIDTH> optimize(std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>&
103-
solution) throw();
102+
solution);
104103

105104
/* start optimization with customized control flow */
106105
_s_t<COSTTYPE, SIMDWIDTH> optimize(std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>&
107-
solution, const mapMAP_control& control_flow) throw();
106+
solution, const mapMAP_control& control_flow);
108107

109108
protected:
110109
/* setup, sanity checks and tools */

mapmap/header/optimizer_instances/dynamic_programming.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CombinatorialDynamicProgramming :
6767
~CombinatorialDynamicProgramming();
6868

6969
_s_t<COSTTYPE, SIMDWIDTH> optimize(
70-
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution) throw();
70+
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution);
7171

7272
protected:
7373
void discover_leaves();

mapmap/header/tree_optimizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class TreeOptimizer
4343

4444
/* optimization procedure - returns new objective value and solution */
4545
virtual _s_t<COSTTYPE, SIMDWIDTH> optimize(
46-
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution) throw() = 0;
46+
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution) = 0;
4747

4848
protected:
4949
bool data_complete();

mapmap/source/costs.impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ FORCEINLINE
373373
const char*
374374
ModeNotSupportedException::
375375
what()
376-
const throw()
376+
const noexcept
377377
{
378378
return m_err_msg.c_str();
379379
}

mapmap/source/dynamic_programming.impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ _s_t<COSTTYPE, SIMDWIDTH>
335335
CombinatorialDynamicProgramming<COSTTYPE, SIMDWIDTH, UNARY, PAIRWISE>::
336336
optimize(
337337
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution)
338-
throw()
339338
{
340339
if(!this->data_complete())
341340
throw std::domain_error("Data for optimization problem "

mapmap/source/graph.impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ add_edge(
185185
const luint_t node_a,
186186
const luint_t node_b,
187187
const COSTTYPE weight)
188-
throw()
189188
{
190189
if(std::max(node_a, node_b) >= m_num_nodes)
191190
throw std::runtime_error("Graph::add_edge: "

mapmap/source/mapmap.impl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ void
9292
mapMAP<COSTTYPE, SIMDWIDTH>::
9393
set_graph(
9494
Graph<COSTTYPE> * graph)
95-
throw()
9695
{
9796
if(m_construct_graph)
9897
throw std::runtime_error("Setting the graph is not allowed "
@@ -111,7 +110,6 @@ void
111110
mapMAP<COSTTYPE, SIMDWIDTH>::
112111
set_label_set(
113112
const LabelSet<COSTTYPE, SIMDWIDTH> * label_set)
114-
throw()
115113
{
116114
if(m_construct_graph)
117115
throw std::runtime_error("Setting the label set is not allowed "
@@ -131,7 +129,6 @@ add_edge(
131129
const luint_t node_a,
132130
const luint_t node_b,
133131
const _s_t<COSTTYPE, SIMDWIDTH> weight)
134-
throw()
135132
{
136133
if(!m_construct_graph)
137134
throw std::runtime_error("Adding edges is only allowed "
@@ -149,7 +146,6 @@ mapMAP<COSTTYPE, SIMDWIDTH>::
149146
set_node_label_set(
150147
const luint_t node_id,
151148
const std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& label_set)
152-
throw()
153149
{
154150
if(!m_construct_graph)
155151
throw std::runtime_error("Setting a label set is only allowed "
@@ -278,7 +274,6 @@ _s_t<COSTTYPE, SIMDWIDTH>
278274
mapMAP<COSTTYPE, SIMDWIDTH>::
279275
optimize(
280276
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution)
281-
throw()
282277
{
283278
/* initialize control flow with standard values */
284279
mapMAP_control std_control;
@@ -305,7 +300,6 @@ mapMAP<COSTTYPE, SIMDWIDTH>::
305300
optimize(
306301
std::vector<_iv_st<COSTTYPE, SIMDWIDTH>>& solution,
307302
const mapMAP_control& control_flow)
308-
throw()
309303
{
310304
_s_t<COSTTYPE, SIMDWIDTH> obj;
311305

0 commit comments

Comments
 (0)