Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions docs/standard-library/domain-error-class.md
Original file line number Diff line number Diff line change
@@ -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).

Expand All @@ -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.

Expand All @@ -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:** \<stdexcept>
**Header:** `<stdexcept>`

**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)
25 changes: 12 additions & 13 deletions docs/standard-library/invalid-argument-class.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand All @@ -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:** \<stdexcept>
**Header:** `<stdexcept>`

**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)
25 changes: 12 additions & 13 deletions docs/standard-library/length-error-class.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand All @@ -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:** \<stdexcept>
**Header:** `<stdexcept>`

**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)
25 changes: 12 additions & 13 deletions docs/standard-library/logic-error-class.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand All @@ -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:** \<stdexcept>
**Header:** `<stdexcept>`

**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)
25 changes: 12 additions & 13 deletions docs/standard-library/out-of-range-class.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand Down Expand Up @@ -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:** \<stdexcept>
**Header:** `<stdexcept>`

**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)
25 changes: 12 additions & 13 deletions docs/standard-library/overflow-error-class.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand Down Expand Up @@ -52,19 +50,20 @@ int main()
cerr << "Type: " << typeid(e).name() << endl;
}
}
/* Output:
```

```Output
Caught: bitset overflow
Type: class std::overflow_error
*/
```

## Requirements

**Header:** \<stdexcept>
**Header:** `<stdexcept>`

**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)
Loading