diff --git a/docs/standard-library/domain-error-class.md b/docs/standard-library/domain-error-class.md index fe6bc72dfe1..c976e9d9d67 100644 --- a/docs/standard-library/domain-error-class.md +++ b/docs/standard-library/domain-error-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: domain_error Class" -title: "domain_error Class" -ms.date: "09/09/2021" +title: "domain_error class" +description: "Learn more about: domain_error class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::domain_error"] helpviewer_keywords: ["domain_error class"] -ms.assetid: a1d8245d-61c2-4d1e-973f-073bd5dd5fa3 --- -# domain_error Class +# `domain_error` class The class serves as the base class for all exceptions thrown to report a domain error (as in mathematics, not networking). @@ -18,13 +17,12 @@ public: explicit domain_error(const string& message); explicit domain_error(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). `domain_error` isn't thrown by any functions in the Microsoft implementation of the C++ Standard Library, but it might be thrown by third-party libraries or user code. @@ -51,19 +49,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: Your domain is in error! Type: class std::domain_error -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[logic_error Class](../standard-library/logic-error-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`logic_error` class](logic-error-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/invalid-argument-class.md b/docs/standard-library/invalid-argument-class.md index 9a3babf927a..f2a22f505cb 100644 --- a/docs/standard-library/invalid-argument-class.md +++ b/docs/standard-library/invalid-argument-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: invalid_argument Class" -title: "invalid_argument Class" -ms.date: "09/09/2021" +title: "invalid_argument class" +description: "Learn more about: invalid_argument class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::invalid_argument"] helpviewer_keywords: ["invalid_argument class"] -ms.assetid: af6c227d-ad7c-4e63-9dee-67af81d83506 --- -# invalid_argument Class +# `invalid_argument` class The class serves as the base class for all exceptions thrown to report an invalid argument. @@ -18,13 +17,12 @@ public: explicit invalid_argument(const string& message); explicit invalid_argument(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). ## Example @@ -49,19 +47,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: invalid bitset char Type: class std::invalid_argument -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[logic_error Class](../standard-library/logic-error-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`logic_error` class](logic-error-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/length-error-class.md b/docs/standard-library/length-error-class.md index 7df63ed20bc..7230d8b628f 100644 --- a/docs/standard-library/length-error-class.md +++ b/docs/standard-library/length-error-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: length_error Class" -title: "length_error Class" -ms.date: "09/09/2021" +title: "length_error class" +description: "Learn more about: length_error class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::length_error"] helpviewer_keywords: ["length_error class"] -ms.assetid: d53c46c5-4626-400d-bd76-bf3e1e0f64ae --- -# length_error Class +# `length_error` class The class serves as the base class for all exceptions thrown to report an attempt to generate an object too long to be specified. @@ -18,13 +17,12 @@ public: explicit length_error(const string& message); explicit length_error(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). ## Example @@ -50,19 +48,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: vector too long Type: class std::length_error -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[logic_error Class](../standard-library/logic-error-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`logic_error` class](logic-error-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/logic-error-class.md b/docs/standard-library/logic-error-class.md index 63f9e82219b..6d096245bda 100644 --- a/docs/standard-library/logic-error-class.md +++ b/docs/standard-library/logic-error-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: logic_error Class" -title: "logic_error Class" -ms.date: "09/09/2021" +title: "logic_error class" +description: "Learn more about: logic_error class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::logic_error"] helpviewer_keywords: ["logic_error class"] -ms.assetid: b290d73d-94e1-4288-af86-2bb5d71f677a --- -# logic_error Class +# `logic_error` class The class serves as the base class for all exceptions thrown to report errors presumably detectable before the program executes, such as violations of logical preconditions. @@ -18,13 +17,12 @@ public: explicit logic_error(const string& message); explicit logic_error(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). ## Example @@ -49,19 +47,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: Does not compute! Type: class std::logic_error -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[exception Class](../standard-library/exception-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`exception` class](exception-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/out-of-range-class.md b/docs/standard-library/out-of-range-class.md index 0fb2d3cb673..cf5e79dfc81 100644 --- a/docs/standard-library/out-of-range-class.md +++ b/docs/standard-library/out-of-range-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: out_of_range Class" -title: "out_of_range Class" -ms.date: "09/09/2021" +title: "out_of_range class" +description: "Learn more about: out_of_range class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::out_of_range"] helpviewer_keywords: ["out_of_range class"] -ms.assetid: d0e14dc0-065e-4666-9ac9-51e52223c503 --- -# out_of_range Class +# `out_of_range` class The class serves as the base class for all exceptions thrown to report an argument that is out of its valid range. @@ -18,13 +17,12 @@ public: explicit out_of_range(const string& message); explicit out_of_range(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). ## Example @@ -52,19 +50,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: invalid string position Type: class std::out_of_range -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[logic_error Class](../standard-library/logic-error-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`logic_error` class](logic-error-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/overflow-error-class.md b/docs/standard-library/overflow-error-class.md index 0ba3c520d48..b4291d01a31 100644 --- a/docs/standard-library/overflow-error-class.md +++ b/docs/standard-library/overflow-error-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: overflow_error Class" -title: "overflow_error Class" -ms.date: "09/09/2021" +title: "overflow_error class" +description: "Learn more about: overflow_error class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::overflow_error"] helpviewer_keywords: ["overflow_error class"] -ms.assetid: bae7128d-e36b-4a45-84f1-2f89da441d20 --- -# overflow_error Class +# `overflow_error` class The class serves as the base class for all exceptions thrown to report an arithmetic overflow. @@ -18,13 +17,12 @@ public: explicit overflow_error(const string& message); explicit overflow_error(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). ## Example @@ -52,19 +50,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: bitset overflow Type: class std::overflow_error -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[runtime_error Class](../standard-library/runtime-error-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`runtime_error` class](runtime-error-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/range-error-class.md b/docs/standard-library/range-error-class.md index a8b6485bcf3..35559c39d45 100644 --- a/docs/standard-library/range-error-class.md +++ b/docs/standard-library/range-error-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: range_error Class" -title: "range_error Class" -ms.date: "09/09/2021" +title: "range_error class" +description: "Learn more about: range_error class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::range_error"] helpviewer_keywords: ["range_error class"] -ms.assetid: 8afb3e88-fc49-4213-b096-ed63d7aea37c --- -# range_error Class +# `range_error` class The class serves as the base class for all exceptions thrown to report a range error (as in mathematics, not iterators). @@ -22,7 +21,7 @@ public: ## Remarks -The value returned by [what](../standard-library/exception-class.md) is a copy of `message.data()`. For more information, see [basic_string::data](../standard-library/basic-string-class.md#data). +The value returned by [`what`](exception-class.md) is a copy of `message.data()`. For more information, see [`basic_string::data`](basic-string-class.md#data). ## Example @@ -47,19 +46,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: The range is in error! Type: class std::range_error -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[runtime_error Class](../standard-library/runtime-error-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`runtime_error` class](runtime-error-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/runtime-error-class.md b/docs/standard-library/runtime-error-class.md index e71e28e5ddf..9ae07afd607 100644 --- a/docs/standard-library/runtime-error-class.md +++ b/docs/standard-library/runtime-error-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: runtime_error Class" -title: "runtime_error Class" -ms.date: "09/09/2021" +title: "runtime_error class" +description: "Learn more about: runtime_error class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::runtime_error"] helpviewer_keywords: ["runtime_error class"] -ms.assetid: 4d0227bf-847b-45a2-a320-2351ebf98368 --- -# runtime_error Class +# `runtime_error` class The class serves as the base class for all exceptions thrown to report errors presumably detectable only when the program executes. @@ -18,13 +17,12 @@ public: explicit runtime_error(const string& message); explicit runtime_error(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). ## Example @@ -49,19 +47,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: bad locale name Type: class std::runtime_error -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[exception Class](../standard-library/exception-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`exception` class](exception-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md) diff --git a/docs/standard-library/underflow-error-class.md b/docs/standard-library/underflow-error-class.md index eee569a3f7b..3b1d405babc 100644 --- a/docs/standard-library/underflow-error-class.md +++ b/docs/standard-library/underflow-error-class.md @@ -1,12 +1,11 @@ --- -description: "Learn more about: underflow_error Class" -title: "underflow_error Class" -ms.date: "09/09/2021" +title: "underflow_error class" +description: "Learn more about: underflow_error class" +ms.date: 09/09/2021 f1_keywords: ["stdexcept/std::underflow_error"] helpviewer_keywords: ["underflow_error class"] -ms.assetid: d632f1f9-9c6c-4954-b96b-03041bfab22d --- -# underflow_error Class +# `underflow_error` class The class serves as the base class for all exceptions thrown to report an arithmetic underflow. @@ -18,13 +17,12 @@ public: explicit underflow_error(const string& message); explicit underflow_error(const char *message); - }; ``` ## Remarks -The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](../standard-library/exception-class.md) and [`data`](../standard-library/basic-string-class.md#data). +The value returned by `what()` is a copy of `message.data()`. For more information, see [`what`](exception-class.md) and [`data`](basic-string-class.md#data). `underflow_error` isn't thrown by any functions in the Microsoft implementation of the C++ Standard Library, but it might be thrown by third-party libraries or user code. @@ -51,19 +49,20 @@ int main() cerr << "Type: " << typeid(e).name() << endl; } } -/* Output: +``` + +```Output Caught: The number's a bit small, captain! Type: class std::underflow_error -*/ ``` ## Requirements -**Header:** \ +**Header:** `` -**Namespace:** std +**Namespace:** `std` ## See also -[runtime_error Class](../standard-library/runtime-error-class.md)\ -[Thread Safety in the C++ Standard Library](../standard-library/thread-safety-in-the-cpp-standard-library.md) +[`runtime_error` class](runtime-error-class.md)\ +[Thread Safety in the C++ Standard Library](thread-safety-in-the-cpp-standard-library.md)