Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/error/get terminate"

From cppreference.com
< cpp‎ | error
m (Update links.)
m (rm rev-box since C++11, because this function is C++11.)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{cpp/title|get_terminate}}
 
{{cpp/title|get_terminate}}
 
{{cpp/error/navbar}}
 
{{cpp/error/navbar}}
{{dcl begin}}
+
{{ddcl|header=exception|since=c++11|
{{dcl header | exception}}
+
std::terminate_handler get_terminate() noexcept;
{{dcl | notes={{mark since c++11}} |1=
+
std::terminate_handler get_terminate();
+
 
}}
 
}}
{{dcl end}}
 
  
 
Returns the currently installed {{lc|std::terminate_handler}}, which may be a null pointer.
 
Returns the currently installed {{lc|std::terminate_handler}}, which may be a null pointer.
 +
 +
This function is thread-safe. Prior call to {{lc|std::set_terminate}} ''synchronizes-with'' (see {{lc|std::memory_order}}) this function.
  
 
===Parameters===
 
===Parameters===
Line 16: Line 15:
 
The currently installed {{lc|std::terminate_handler}}.
 
The currently installed {{lc|std::terminate_handler}}.
  
===Exceptions===
+
===Example===
{{noexcept}}
+
{{example}}
  
 
===See also===
 
===See also===
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc inc | cpp/error/dsc terminate_handler}}
+
{{dsc inc|cpp/error/dsc terminate_handler}}
{{dsc inc | cpp/error/dsc set_terminate}}
+
{{dsc inc|cpp/error/dsc set_terminate}}
 
{{dsc end}}
 
{{dsc end}}
  
[[de:cpp/error/get terminate]]
+
{{langlinks|de|es|fr|it|ja|pt|ru|zh}}
[[es:cpp/error/get terminate]]
+
[[fr:cpp/error/get terminate]]
+
[[it:cpp/error/get terminate]]
+
[[ja:cpp/error/get terminate]]
+
[[pt:cpp/error/get terminate]]
+
[[ru:cpp/error/get terminate]]
+
[[zh:cpp/error/get terminate]]
+

Latest revision as of 10:22, 9 July 2024

 
 
 
Defined in header <exception>
std::terminate_handler get_terminate() noexcept;
(since C++11)

Returns the currently installed std::terminate_handler, which may be a null pointer.

This function is thread-safe. Prior call to std::set_terminate synchronizes-with (see std::memory_order) this function.

Contents

[edit] Parameters

(none)

[edit] Return value

The currently installed std::terminate_handler.

[edit] Example

[edit] See also

the type of the function called by std::terminate
(typedef) [edit]
changes the function to be called by std::terminate
(function) [edit]