Skip to content

Commit 8164484

Browse files
author
mikeblome
committed
fixed typo and metadata
1 parent 2d8acc6 commit 8164484

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎docs/cpp/static-assert.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "static_assert"
33
ms.date: "07/29/2019"
44
f1_keywords: ["static_assert_cpp"]
5-
helpviewer_keywords: ["C++ keywords, static_assert", "C2338", "assertions [C++], static_assert", "static_assert"]
5+
helpviewer_keywords: ["assertions [C++], static_assert", "static_assert"]
66
ms.assetid: 28dd3668-e78c-4de8-ba68-552084743426
77
---
88
# static_assert
@@ -14,7 +14,7 @@ Tests a software assertion at compile time. If the specified constant expression
1414
```
1515
static_assert( constant-expression, string-literal );
1616
17-
static_assert( constant-expression ); // C++17 (Visual Studio 2017 and later)s
17+
static_assert( constant-expression ); // C++17 (Visual Studio 2017 and later)
1818
```
1919

2020
#### Parameters
@@ -28,7 +28,7 @@ static_assert( constant-expression ); // C++17 (Visual Studio 2017 and later)s
2828

2929
The *constant-expression* parameter of a **static_assert** declaration represents a *software assertion*. A software assertion specifies a condition that you expect to be true at a particular point in your program. If the condition is true, the **static_assert** declaration has no effect. If the condition is false, the assertion fails, the compiler displays the message in *string-literal* parameter, and the compilation fails with an error. In Visual Studio 2017 and later, the string-literal parameter is optional.
3030

31-
The **static_assert** declaration tests a software assertion at compile time. In contrast, the [assert Macro, _assert, _wassert](../c-runtime-library/reference/assert-macro-assert-wassert.md) macro tests a software assertion at run time and incurs a run time cost in space or time. The **static_assert** declaration is especially useful for debugging templates because template arguments can be included in the *constant-expression* parameter.
31+
The **static_assert** declaration tests a software assertion at compile time. In contrast, the [assert Macro and _assert and _wassert functions](../c-runtime-library/reference/assert-macro-assert-wassert.md) test a software assertion at run time and incur a run time cost in space or time. The **static_assert** declaration is especially useful for debugging templates because template arguments can be included in the *constant-expression* parameter.
3232

3333
The compiler examines the **static_assert** declaration for syntax errors when the declaration is encountered. The compiler evaluates the *constant-expression* parameter immediately if it does not depend on a template parameter. Otherwise, the compiler evaluates the *constant-expression* parameter when the template is instantiated. Consequently, the compiler might issue a diagnostic message once when the declaration is encountered, and again when the template is instantiated.
3434

0 commit comments

Comments
 (0)