Changeset 1378
- Timestamp:
- 12/14/09 01:43:13 (15 years ago)
- Files:
-
- trunk/docsrc/cpp0x.dd (modified) (1 diff)
- trunk/docsrc/module.dd (modified) (1 diff)
- trunk/docsrc/statement.dd (modified) (2 diffs)
- trunk/docsrc/template-comparison.dd (modified) (1 diff)
- trunk/docsrc/version.dd (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docsrc/cpp0x.dd
r1245 r1378 100 100 $(SECTION3 $(LNAME2 move-semantics, Extending Move Semantics To *this (Revision 2)), 101 101 102 102 $(P $(LINK2 $(NDOCS)2007/n2439.htm, N2439): TBD 103 103 ) 104 104 105 105 ) 106 106 107 107 $(SECTION3 $(LNAME2 static-assert, static_assert), 108 108 109 109 $(P $(LINK2 $(NDOCS)2004/n1720.html, N1720): 110 $(LINK2 version.html# staticassert, static assert) is110 $(LINK2 version.html#StaticAssert, static assert) is 111 111 part of D. 112 112 ) 113 113 114 114 ) 115 115 116 116 $(SECTION3 $(LNAME2 template-aliases, Template aliases for C++), 117 117 118 118 $(P $(LINK2 $(NDOCS)2007/n2258.pdf, N2258): 119 119 Both $(LINK2 template.html, templates and template instantiations) 120 120 can be $(LINK2 declaration.html#alias, aliased): trunk/docsrc/module.dd
r932 r1378 18 18 $(I ClassDeclaration) 19 19 $(I InterfaceDeclaration) 20 20 $(I AggregateDeclaration) 21 21 $(I Declaration) 22 22 $(I Constructor) 23 23 $(I Destructor) 24 24 $(I Invariant) 25 25 $(I UnitTest) 26 26 $(I StaticConstructor) 27 27 $(I StaticDestructor) 28 $(LINK2 version.html#DebugSpecification, $(I DebugSpecification)) 29 $(LINK2 version.html#VersionSpecification, $(I VersionSpecification)) 28 $(LINK2 version.html#ConditionalDeclaration, $(I ConditionalDeclaration)) 29 $(LINK2 version.html#StaticAssert, $(I StaticAssert)) 30 $(LINK2 template.html#TemplateDeclaration, $(I TemplateDeclaration)) 31 $(LINK2 template-mixin.html#TemplateMixin, $(I TemplateMixin)) 30 32 $(GLINK MixinDeclaration) 31 33 $(B ;) 32 34 ) 33 35 34 36 35 37 $(P Modules have a one-to-one correspondence with source files. 36 38 The module name is the file name with the path and extension 37 39 stripped off. 38 40 ) 39 41 trunk/docsrc/statement.dd
r1375 r1378 22 22 23 23 $(GNAME NonEmptyOrScopeBlockStatement): 24 24 $(GLINK NonEmptyStatement) 25 25 $(GLINK ScopeBlockStatement) 26 26 27 27 $(GNAME NonEmptyStatement): 28 28 $(GLINK LabeledStatement) 29 29 $(GLINK ExpressionStatement) 30 30 $(GLINK DeclarationStatement) 31 31 $(GLINK IfStatement) 32 $(LINK2 version.html, $(I ConditionalStatement))33 32 $(GLINK WhileStatement) 34 33 $(GLINK DoStatement) 35 34 $(GLINK ForStatement) 36 35 $(GLINK ForeachStatement) 37 36 $(GLINK SwitchStatement) 38 37 $(V2 $(GLINK FinalSwitchStatement) 39 38 ) $(GLINK CaseStatement) 40 39 $(V2 $(GLINK CaseRangeStatement) 41 40 ) $(GLINK DefaultStatement) 42 41 $(GLINK ContinueStatement) … … 46 45 $(GLINK WithStatement) 47 46 $(GLINK SynchronizedStatement) 48 47 $(GLINK TryStatement) 49 48 $(GLINK ScopeGuardStatement) 50 49 $(GLINK ThrowStatement) 51 50 $(V1 $(GLINK VolatileStatement) 52 51 ) $(GLINK AsmStatement) 53 52 $(GLINK PragmaStatement) 54 53 $(GLINK MixinStatement) 55 54 $(V2 $(GLINK ForeachRangeStatement)) 55 $(LINK2 version.html#ConditionalStatement, $(I ConditionalStatement)) 56 $(LINK2 version.html#StaticAssert, $(I StaticAssert)) 57 $(LINK2 template-mixin.html#TemplateMixin, $(I TemplateMixin)) 56 58 ) 57 59 58 60 <h2>$(LNAME2 ScopeStatement, Scope Statements)</h2> 59 61 60 62 $(GRAMMAR 61 63 $(I ScopeStatement): 62 64 $(GLINK NonEmptyStatement) 63 65 $(GLINK BlockStatement) 64 66 ) 65 67 trunk/docsrc/template-comparison.dd
r784 r1378 137 137 Foo<double> f = { 1.2, 3, 6.8 }; 138 138 ) 139 139 ) 140 140 ) 141 141 142 142 $(TR 143 143 $(TD Concepts) 144 144 $(V1 145 145 $(TD No, but much the same effect can be achieved with 146 146 $(LINK2 version.html#staticif, static if) and 147 $(LINK2 version.html# staticassert, static asserts))147 $(LINK2 version.html#StaticAssert, static asserts)) 148 148 ) 149 149 $(V2 150 150 $(TD Yes: $(LINK2 cpp0x.html#concepts, Constraints)) 151 151 ) 152 152 $(TD No) 153 153 $(TD Yes: $(LINK2 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1849.pdf, Concepts for C++0x N1849)) 154 154 ) 155 155 156 156 157 157 $(TR trunk/docsrc/version.dd
r1372 r1378 3 3 $(SPEC_S Conditional Compilation, 4 4 5 5 $(P $(I Conditional compilation) is the process of selecting which 6 6 code to compile and which code to not compile. 7 7 (In C and C++, conditional compilation is done with the preprocessor 8 8 directives $(CODE #if) / $(CODE #else) / $(CODE #endif).) 9 9 ) 10 10 11 11 $(GRAMMAR 12 12 $(GNAME ConditionalDeclaration): 13 $( ICondition) $(I CCDeclarationBlock)14 $( ICondition) $(I CCDeclarationBlock) $(B else) $(I CCDeclarationBlock)15 $( ICondition) $(B :) $(I Declarations)13 $(GLINK Condition) $(I CCDeclarationBlock) 14 $(GLINK Condition) $(I CCDeclarationBlock) $(B else) $(I CCDeclarationBlock) 15 $(GLINK Condition) $(B :) $(I Declarations) 16 16 17 17 $(GNAME CCDeclarationBlock): 18 $( I Declaration)18 $(LINK2 declaration.html#Declaration, $(I Declaration)) 19 19 $(B {) $(I Declarations) $(B }) 20 20 $(B { }) 21 21 22 22 $(GNAME Declarations): 23 $( I Declaration)24 $( I Declaration) $(I Declarations)23 $(LINK2 declaration.html#Declaration, $(I Declaration)) 24 $(LINK2 declaration.html#Declaration, $(I Declaration)) $(I Declarations) 25 25 26 26 $(GNAME ConditionalStatement): 27 $( I Condition) $(I NoScopeNonEmptyStatement)28 $( I Condition) $(I NoScopeNonEmptyStatement) $(B else) $(I NoScopeNonEmptyStatement)29 ) 30 31 $(P If the $( ICondition) is satisfied, then the following27 $(GLINK Condition) $(LINK2 statement.html#NoScopeNonEmptyStatement, $(I NoScopeNonEmptyStatement)) 28 $(GLINK Condition) $(LINK2 statement.html#NoScopeNonEmptyStatement, $(I NoScopeNonEmptyStatement)) $(B else) $(LINK2 statement.html#NoScopeNonEmptyStatement, $(I NoScopeNonEmptyStatement)) 29 ) 30 31 $(P If the $(GLINK Condition) is satisfied, then the following 32 32 $(I CCDeclarationBlock) or $(I Statement) is compiled in. 33 33 If it is not satisfied, the $(I CCDeclarationBlock) or $(I Statement) 34 34 after the optional $(CODE else) is compiled in. 35 35 ) 36 36 37 37 $(P Any $(I CCDeclarationBlock) or $(I Statement) that is not 38 38 compiled in still must be syntactically correct. 39 39 ) 40 40 41 41 $(P No new scope is introduced, even if the 42 42 $(I CCDeclarationBlock) or $(I Statement) 43 43 is enclosed by $(CODE { }). 44 44 ) 45 45 46 46 $(P $(I ConditionalDeclaration)s and $(I ConditionalStatement)s 47 47 can be nested. 48 48 ) 49 49 50 $(P The $(LINK2 # staticassert, $(I StaticAssert)) can be used50 $(P The $(LINK2 #StaticAssert, $(I StaticAssert)) can be used 51 51 to issue errors at compilation time for branches of the conditional 52 52 compilation that are errors. 53 53 ) 54 54 55 55 $(P $(I Condition) comes in the following forms: 56 56 ) 57 57 58 58 $(GRAMMAR 59 59 $(GNAME Condition): 60 60 $(LINK2 #version, $(I VersionCondition)) … … 437 437 ) 438 438 $(LI For unsatisfied conditions, the conditionally compiled code 439 439 need only be syntactically correct. It does not have to be 440 440 semantically correct. 441 441 ) 442 442 $(LI It must be evaluatable at compile time. 443 443 ) 444 444 ) 445 445 446 446 447 <h2>$(LNAME2 static-assert, $(LNAME2 staticassert, Static Assert))</h2>447 <h2>$(LNAME2 static-assert, $(LNAME2 StaticAssert, Static Assert))</h2> 448 448 449 449 $(GRAMMAR 450 450 $(GNAME StaticAssert): 451 451 $(B static assert $(LPAREN)) $(ASSIGNEXPRESSION) $(B $(RPAREN);) 452 452 $(B static assert $(LPAREN)) $(ASSIGNEXPRESSION) $(B ,) $(ASSIGNEXPRESSION) $(B $(RPAREN);) 453 453 ) 454 454 455 455 $(P $(ASSIGNEXPRESSION) is evaluated at compile time, and converted 456 456 to a boolean value. If the value is true, the static assert 457 457 is ignored. If the value is false, an error diagnostic is issued
