Revision history for KeyPgTypeTemp


Revision [22518]

Last edited on 2018-10-04 04:05:02 by fxm [Added preciser sentence on releasing of temporary objects]
Additions:
A temporary object is destroyed at the end of execution of the statement (where it's defined), but its corresponding allocated memory is not released and remains available (unused) until going out the scope where statement is.


Revision [21714]

Edited on 2016-11-25 16:46:27 by fxm [STATIC used at procedure definition does not apply to temporary types]
Additions:
Note: ##[[KeyPgStatic|Static]]## qualifier used at procedure definition level does not apply to temporary types.
Deletions:
Note: ##[[KeyPgStatic|Static]]## qualifier used at procedure definition level does not applied on temporary types.


Revision [21713]

Edited on 2016-11-25 12:50:06 by fxm [STATIC used at procedure definition does not applied on temporary types]
Additions:
Note: ##[[KeyPgStatic|Static]]## qualifier used at procedure definition level does not applied on temporary types.


Revision [21597]

Edited on 2016-09-27 08:57:57 by fxm [Clearer wording for case where a constructor exists]
Additions:
The ##[[KeyPgConstructor|Constructor]]## for the type, if there is one with parameters matching with the ##//initializers//## provided, will be called when the temporary copy is created, and the ##[[KeyPgDestructor|Destructor]]## for the type, if there is one, will be called immediately after its use. But when there is a matching constructor, the temporary type expression may be simply replaced by ##//typename( initializers//, ... )##.
If there is a constructor at least but none which matches with the ##//initializers//##, the temporary type syntax is obviously disallowed.
Deletions:
The ##[[KeyPgConstructor|Constructor]]## for the type, if there is one, will be called when the temporary copy is created, and the ##[[KeyPgDestructor|Destructor]]## for the type, if there is one, will be called immediately after its use. But when there is a constructor, the temporary type expression may be simply replaced by ##//typename( initializers//, ... )##.


Revision [21491]

Edited on 2016-05-20 03:31:20 by fxm [Added the case of type which inherits a constructor (or is directly or indirectly derived from OBJECT)]
Additions:
For a type without own or inherited constructor (excluding also any type that is directly or indirectly derived from ##[[KeyPgObject|Object]]##), the temporary type syntax is allowed if all type data-fields (including those inherited) are numeric primitives only and without any default initializers.
Deletions:
For a type without constructor (excluding also any type that is directly or indirectly derived from ##[[KeyPgObject|Object]]## using ##[[KeyPgExtends|Extends]]##), the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers.


Revision [21482]

Edited on 2016-05-18 16:11:11 by fxm [Added the case of Type that is directly or indirectly derived from Object]
Additions:
For a type without constructor (excluding also any type that is directly or indirectly derived from ##[[KeyPgObject|Object]]## using ##[[KeyPgExtends|Extends]]##), the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers.
If at same time the type is without destructor, the compiler does a direct assignment instead of using a temporary copy.
Deletions:
For a type without constructor, the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers, but the compiler does a direct assignment instead of using a temporary copy if at same time the type is without destructor.


Revision [21277]

Edited on 2016-03-28 08:20:25 by fxm [The initialization of last data-fields can be omitted]
Additions:
Initial values for the type (or only the firsts)
It can also be used as an even shorter shortcut than ##[[KeyPgWith|With]]## (see below) if you are changing all the data-fields (or the n firsts only).
Deletions:
Initial values for the type
It can also be used as an even shorter shortcut than ##[[KeyPgWith|With]]## (see below) if you are changing all the records.


Revision [21163]

Edited on 2016-03-13 11:28:24 by fxm [Formatting]
Additions:





Revision [20564]

Edited on 2016-02-10 16:09:51 by DkLwikki [Update link format]
Additions:
The name of the ##[[KeyPgType|Type]]## or ##[[KeyPgUnion|Union]]##
The ##[[KeyPgConstructor|Constructor]]## for the type, if there is one, will be called when the temporary copy is created, and the ##[[KeyPgDestructor|Destructor]]## for the type, if there is one, will be called immediately after its use. But when there is a constructor, the temporary type expression may be simply replaced by ##//typename( initializers//, ... )##.
It can also be used as an even shorter shortcut than ##[[KeyPgWith|With]]## (see below) if you are changing all the records.
- ##[[KeyPgType|Type...End Type]]##
- ##[[KeyPgTypeAlias|Type (Alias)]]##
Deletions:
The name of the ##[[KeyPgType Type]]## or ##[[KeyPgUnion Union]]##
The ##[[KeyPgConstructor Constructor]]## for the type, if there is one, will be called when the temporary copy is created, and the ##[[KeyPgDestructor Destructor]]## for the type, if there is one, will be called immediately after its use. But when there is a constructor, the temporary type expression may be simply replaced by ##//typename( initializers//, ... )##.
It can also be used as an even shorter shortcut than ##[[KeyPgWith With]]## (see below) if you are changing all the records.
- ##[[KeyPgType Type...End Type]]##
- ##[[KeyPgTypeAlias Type (Alias)]]##


Revision [17366]

Edited on 2014-10-28 10:29:28 by FxMwikki [Since fbc 0.90.0, TYPE<UDTwithoutCtor>() almost always creates a temporary copy]
Additions:
For a type without constructor, the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers, but the compiler does a direct assignment instead of using a temporary copy if at same time the type is without destructor.
Deletions:
For a type without constructor, the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers.


Revision [17365]

Edited on 2014-10-28 09:52:44 by FxMwikki [Since fbc 0.90.0, TYPE<UDT_without_ctor>() always creates a temporary copy]
Additions:
For a type without constructor, the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers.
Deletions:
For a type without constructor, the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers, but the compiler does a direct assignment instead of using a temporary copy.


Revision [16986]

Edited on 2013-12-31 03:41:57 by FxMwikki [Type<data-type>() constructs also temporary copy of any standard data-type excluding fix-len string]
Additions:
It can create not only a temporary copy of an user defined type, but also a temporary copy of predefined data-type as a variable-length string or any numeric data-type (all standard data-types excluding fixed-length strings).


Revision [16736]

Edited on 2013-04-29 04:15:51 by FxMwikki [Removing the confusion with an real anonymous type (which is nested in a named UDT)]
Additions:
Used to create a temporary type. If ##//typename//## is not explicitly given, it will be inferred from its usage if possible. Usage of the temporary copy may include assigning it to a variable, passing it as a parameter to a procedure, or returning it as a value from a procedure.
Deletions:
Used to create an anonymous and temporary type. If ##//typename//## is not explicitly given, it will be inferred from its usage if possible. Usage of the temporary copy may include assigning it to a variable, passing it as a parameter to a procedure, or returning it as a value from a procedure.


Revision [16410]

Edited on 2012-10-27 20:50:11 by CountingPine [Grammar/clarity]
Additions:
For a type without constructor, the temporary type syntax is allowed if all type data-fields are numeric primitives only and without any default initializers, but the compiler does a direct assignment instead of using a temporary copy.
Deletions:
For type without constructor, the temporary type syntax is allowed if all type data-fields are numeric only (excluding string) and without any default initializer, but compiler assigns directly instead of using a temporary copy.


Revision [16409]

Edited on 2012-10-27 17:23:59 by FxMwikki [Added the precise behavior for type without constructor]
Additions:
For type without constructor, the temporary type syntax is allowed if all type data-fields are numeric only (excluding string) and without any default initializer, but compiler assigns directly instead of using a temporary copy.
Deletions:
For type without constructor, temporary type is valid if all type data-fields are numeric only (excluding string) and without any default initializer.


Revision [16079]

Edited on 2012-02-05 01:47:33 by FxMwikki [Add condition for use temporary type without constructor + variant when constructor]
Additions:
Used to create an anonymous and temporary type. If ##//typename//## is not explicitly given, it will be inferred from its usage if possible. Usage of the temporary copy may include assigning it to a variable, passing it as a parameter to a procedure, or returning it as a value from a procedure.
For type without constructor, temporary type is valid if all type data-fields are numeric only (excluding string) and without any default initializer.
The ##[[KeyPgConstructor Constructor]]## for the type, if there is one, will be called when the temporary copy is created, and the ##[[KeyPgDestructor Destructor]]## for the type, if there is one, will be called immediately after its use. But when there is a constructor, the temporary type expression may be simply replaced by ##//typename( initializers//, ... )##.
Deletions:
Used to create an anonymous and temporary type. If ##//typename//## is not explicitly given, it will be inferred from its usage. Usage of the temporary copy may include assigning it to a variable, passing it as a parameter to a procedure, or returning it as a value from a procedure.
For type without constructor, temporary type is valid if all type data-fields are numeric only (excluding string) and without any ##//initializer//##.
The ##[[KeyPgConstructor Constructor]]## for the type, if there is one, will be called when the temporary copy is created. And the ##[[KeyPgDestructor Destructor]]## for the type, if there is one, will be called immediately after its use.


Revision [16070]

Edited on 2012-02-04 08:25:08 by FxMwikki [Add condition for use temporary type without constructor]
Additions:
For type without constructor, temporary type is valid if all type data-fields are numeric only (excluding string) and without any ##//initializer//##.
Deletions:
For type without constructor, temporary type is valid if all type data-fields are numeric only (excluding string) and without any initializer.


Revision [16069]

Edited on 2012-02-04 08:22:19 by FxMwikki [Condition for use temporary type without constructor]
Additions:
For type without constructor, temporary type is valid if all type data-fields are numeric only (excluding string) and without any initializer.


Revision [14453]

Edited on 2009-08-29 21:57:20 by CountingPine [Remove CamelCase links in "New to FreeBASIC"]
Additions:
- New to ""FreeBASIC""
Deletions:
- New to FreeBASIC


Revision [12496]

The oldest known version of this page was created on 2008-01-19 09:52:30 by JeffMarshall [Remove CamelCase links in "New to FreeBASIC"]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode