14.5.7 This access
来源:互联网 发布:win7系统内存优化 编辑:程序博客网 时间:2024/05/17 19:58
A this-access consists of the reserved word this.
this-access:
this
A this-access is permitted only in the block of an instance constructor, an
instance method, or an instance
accessor. It has one of the following meanings:
?When this is used in a primary-expression within an instance constructor
of a class, it is classified as a
value. The type of the value is the class within which the usage occurs,
and the value is a reference to the
object being constructed.
Chapter 14 Expressions
145
?When this is used in a primary-expression within an instance method or
instance accessor of a class, it
is classified as a value. The type of the value is the class within which
the usage occurs, and the value is
a reference to the object for which the method or accessor was invoked.
?When this is used in a primary-expression within an instance constructor
of a struct, it is classified as a
variable. The type of the variable is the struct within which the usage
occurs, and the variable represents
the struct being constructed. The this variable of an instance constructor
of a struct behaves exactly the
same as an out parameter of the struct type?in particular, this means that
the variable must be
definitely assigned in every execution path of the instance constructor.
?When this is used in a primary-expression within an instance method or
instance accessor of a struct, it
is classified as a variable. The type of the variable is the struct within
which the usage occurs, and the
variable represents the struct for which the method or accessor was
invoked. The this variable of an
instance method of a struct behaves exactly the same as a ref parameter of
the struct type.
Use of this in a primary-expression in a context other than the ones listed
above is a compile-time error. In
particular, it is not possible to refer to this in a static method, a
static property accessor, or in a variableinitializer
of a field declaration.
this-access:
this
A this-access is permitted only in the block of an instance constructor, an
instance method, or an instance
accessor. It has one of the following meanings:
?When this is used in a primary-expression within an instance constructor
of a class, it is classified as a
value. The type of the value is the class within which the usage occurs,
and the value is a reference to the
object being constructed.
Chapter 14 Expressions
145
?When this is used in a primary-expression within an instance method or
instance accessor of a class, it
is classified as a value. The type of the value is the class within which
the usage occurs, and the value is
a reference to the object for which the method or accessor was invoked.
?When this is used in a primary-expression within an instance constructor
of a struct, it is classified as a
variable. The type of the variable is the struct within which the usage
occurs, and the variable represents
the struct being constructed. The this variable of an instance constructor
of a struct behaves exactly the
same as an out parameter of the struct type?in particular, this means that
the variable must be
definitely assigned in every execution path of the instance constructor.
?When this is used in a primary-expression within an instance method or
instance accessor of a struct, it
is classified as a variable. The type of the variable is the struct within
which the usage occurs, and the
variable represents the struct for which the method or accessor was
invoked. The this variable of an
instance method of a struct behaves exactly the same as a ref parameter of
the struct type.
Use of this in a primary-expression in a context other than the ones listed
above is a compile-time error. In
particular, it is not possible to refer to this in a static method, a
static property accessor, or in a variableinitializer
of a field declaration.
- 14.5.7 This access
- Illegal access: this web application instance has been stopped already
- You don't have permission to access / on this server
- yii-You are not allowed to access this page
- You don't have permission to access /*** on this server
- yii-You are not allowed to access this page
- yii-You are not allowed to access this page
- Illegal access: this web application instance has been stopped already.
- You don't have permission to access / on this server.
- SecurityError: Error #3207: Application-sandbox content cannot access this feature.
- No active FlowSession to access; this FlowExecution has ended
- You don't have permission to access on this server.
- Illegal access: this web application instance has been stopped already . .
- yii gii You are not allowed to access this page.
- Illegal access: this web application instance has been stopped already
- Illegal access: this web application instance has been stopped already
- You don't have permission to access / on this server.
- You don't have permission to access ××× on this server.
- 14.5.2 Simple names
- 14.5.3 Parenthesized expressions
- 14.5.4 Member access
- 14.5.5 Invocation expressions
- 14.5.6 Element access
- 14.5.7 This access
- 14.5.9 Postfix in- & decrement operators
- 14.5.10 The new operator
- 14.5.10.1 Object creation expressions
- 14.5.10.2 Array creation expressions
- 14.5.10.3 Delegate creation expressions
- 14.5.11 The typeof operator
- 14.5.12 The checked & unchecked operators
- Qomolangma实现篇(二):命名空间和别名子系统的实现