Skip to content

Commit 131e46e

Browse files
authored
throw() -> noexcept (#3092)
1 parent 3cb1f35 commit 131e46e

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

dlib/any/any_abstract.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace dlib
2020
!*/
2121

2222
public:
23-
virtual const char* what() const throw() { return "bad_any_cast"; }
23+
virtual const char* what() const noexcept { return "bad_any_cast"; }
2424
};
2525

2626
// ----------------------------------------------------------------------------------------

dlib/cmd_line_parser/cmd_line_parser_check_1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace dlib
8282
required_opts()
8383
{ set_info_string(); }
8484

85-
~cmd_line_check_error() throw() {}
85+
~cmd_line_check_error() noexcept {}
8686

8787
void set_info_string (
8888
)

dlib/cmd_line_parser/cmd_line_parser_kernel_1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ namespace dlib
119119
num(0)
120120
{ set_info_string();}
121121

122-
~cmd_line_parse_error() throw() {}
122+
~cmd_line_parse_error() noexcept {}
123123

124124
const std::basic_string<charT> item;
125125
const unsigned long num;

dlib/config_reader/config_reader_kernel_1.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace dlib
9090
file_name(file_name_)
9191
{}
9292

93-
~file_not_found() throw() {}
93+
~file_not_found() noexcept {}
9494

9595
public:
9696
const std::string file_name;
@@ -117,7 +117,7 @@ namespace dlib
117117
const_cast<std::string&>(info) = sout.str();
118118
}
119119

120-
~config_reader_access_error() throw() {}
120+
~config_reader_access_error() noexcept {}
121121
const std::string block_name;
122122
const std::string key_name;
123123
};

dlib/error.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ namespace dlib
105105
!*/
106106

107107
virtual ~error(
108-
) throw() {}
108+
) noexcept {}
109109
/*!
110110
ensures
111111
- does nothing
112112
!*/
113113

114114
const char* what(
115-
) const throw()
115+
) const noexcept
116116
/*!
117117
ensures
118118
- if (info.size() != 0) then
@@ -128,7 +128,7 @@ namespace dlib
128128
}
129129

130130
const char* type_to_string (
131-
) const throw()
131+
) const noexcept
132132
/*!
133133
ensures
134134
- returns a string that names the contents of the type member.

dlib/misc_api/misc_api_kernel_1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ namespace dlib
9090
name(dir_name)
9191
{}
9292

93-
~dir_create_error() throw() {}
93+
~dir_create_error() noexcept {}
9494
const std::string name;
9595
};
9696

dlib/std_allocator.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ namespace dlib
6666
/*constructors and destructor
6767
*-nothing to do because the std_allocator has no state
6868
*/
69-
std_allocator() throw() { }
69+
std_allocator() noexcept { }
7070

71-
std_allocator(const std_allocator&) throw() { }
71+
std_allocator(const std_allocator&) noexcept { }
7272

7373
template <typename U>
74-
std_allocator (const std_allocator<U,M>&) throw() { }
74+
std_allocator (const std_allocator<U,M>&) noexcept { }
7575

76-
~std_allocator() throw() { }
76+
~std_allocator() noexcept { }
7777

7878
//return maximum number of elements that can be allocated
79-
size_type max_size () const throw()
79+
size_type max_size () const noexcept
8080
{
8181
//for numeric_limits see Section 4.3, page 59
8282
return std::numeric_limits<size_t>::max() / sizeof(T);
@@ -173,14 +173,14 @@ namespace dlib
173173
bool operator== (
174174
const std_allocator<T1,M1>&,
175175
const std_allocator<T2,M2>&
176-
) throw()
176+
) noexcept
177177
{ return std_alloc_compare<M1,M2>::are_interchangeable; }
178178

179179
template <typename T1, typename M1, typename T2, typename M2>
180180
bool operator!= (
181181
const std_allocator<T1,M1>&,
182182
const std_allocator<T2,M2>&
183-
) throw()
183+
) noexcept
184184
{ return !std_alloc_compare<M1,M2>::are_interchangeable; }
185185

186186
// ----------------------------------------------------------------------------------------

dlib/svm/one_vs_all_trainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ namespace dlib
9191
) : dlib::error(msg), l(l_) {};
9292

9393
virtual ~invalid_label(
94-
) throw() {}
94+
) noexcept {}
9595

9696
label_type l;
9797
};

dlib/svm/one_vs_one_trainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ namespace dlib
9393
) : dlib::error(msg), l1(l1_), l2(l2_) {};
9494

9595
virtual ~invalid_label(
96-
) throw() {}
96+
) noexcept {}
9797

9898
label_type l1, l2;
9999
};

dlib/type_safe_union/type_safe_union_kernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace dlib
1818
class bad_type_safe_union_cast : public std::bad_cast
1919
{
2020
public:
21-
virtual const char * what() const throw()
21+
virtual const char * what() const noexcept
2222
{
2323
return "bad_type_safe_union_cast";
2424
}

0 commit comments

Comments
 (0)